Skip to content

Using >> in Spyder #114

Answered by pwwang
ce88888 asked this question in Q&A
Apr 24, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi,

It's not silly at all. We are able to retrieve the AST at runtime in VSCode/Jupyter/IPython, allowing us to run the datar code smoothly. Seeing the AST allows us to tell whether the verbs are called in the form of df >> verb(...) or verb(df, ...). I am not a Spyder user, but I guess Spyder is blind to AST at runtime. In such a case, you will need to tell datar that you are running in a "blind" environment:

from datar import options
options(assume_all_piping=True)

from datar.all import nrow
from datar.datasets import mtcars

print(mtcars >> nrow())

You can check out some details here: https://pwwang.github.io/datar/caveats/blind/

If you don't want to change the options every time, you…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ce88888
Comment options

@pwwang
Comment options

Answer selected by pwwang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants