Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is gonb support table? #137

Open
ChengYen-Tang opened this issue Oct 11, 2024 · 6 comments
Open

Is gonb support table? #137

ChengYen-Tang opened this issue Oct 11, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@ChengYen-Tang
Copy link

Just like python pandas, when I print the dataframe, Jupyter will display a table
pandas-dev/pandas#16792

@janpfeifer
Copy link
Owner

Yes, this is high on my wish-list for gonb. It shouldn't be that hard, except, which Go library to support data views should one use ? Any suggestions ?

@janpfeifer janpfeifer added the enhancement New feature or request label Oct 11, 2024
@ChengYen-Tang
Copy link
Author

I don't have any idea either😅

@janpfeifer
Copy link
Owner

Let's keep this open. I'm sure something is going to come up, and then we add it. But definitely this is something that would be very helpful to have.

@ChengYen-Tang
Copy link
Author

Other questions,

!*go mod edit -replace "test=/mnt/f/test"
!*cat go.mod

I expect to be able to use pwd, similar to the following

!*go mod edit -replace "test=$(pwd)"
!*cat go.mod

But, $(pwd) = tmp/xxx
I konw, because I uesd '!*'

@janpfeifer
Copy link
Owner

janpfeifer commented Oct 16, 2024

Ha, so it's good you already understood that when !* is used, it changes the directory to the temporary cell code directory.

Now the directory with the cell code is also available in the ${GONB_TMP_DIR} variable. So what you could do is:

!dd=$(pwd); cd ${GONB_TMP_DIR} ; go mod edit -replace "test=${dd}"; cat go.mod

Btw, to see all environment variables visible:

!set

@janpfeifer
Copy link
Owner

janpfeifer commented Oct 17, 2024

Oh, btw, GoNB also sets $GONB_DIR with the directory where the cells are being run from. So a simpler alternative would be:

!*go mod edit -replace "test=${GONB_DIR}"
!*cat go.mod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants