-
Hello there I'm a hobbyist so forgive me if this is a silly question. I've previously used R a lot and so was thankful when I came across datar when I started working in python. I still haven't settled on a dev environment and have been using VSCode and Spyder. In Spyder (love the variable explorer compared to VSCode!), I can' t execute a cell which has piping in it - I suppose for the reasons you outline under 'caveat'. The same works fine when I paste this into a VSCode notebook. If I execute the same code in the Spyder console it works fine (presumably that's IPython. I've tried google but can't figure out how I switch the main execution of individual cells in Spyder to IPython. Have you come across this issue and could you point me towards a fix? Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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 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 can save it to a configuration file. See here: |
Beta Was this translation helpful? Give feedback.
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(...)
orverb(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 telldatar
that you are running in a "blind" environment: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…