-
Notifications
You must be signed in to change notification settings - Fork 18
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
pipe operator doesn't work in plain python prompt #45
Comments
What's the OS? Windows? Linux? |
windows 10
anaconda prompt (anaconda3) - python.exe 3.8.1
0.4.2 |
However, the source code is not available when the code is running in plain python prompt, thus There are several solutions for this:
|
I'm using PyCharm with Anaconda + plain python prompt, will try switching to ipython then; thanks so much for your quick answers! |
You are welcome! Thank you for reporting!
|
With this revision 9bd9d02, one could use the "all piping" mode (all verbs are supposed to be used in piping syntax): from datar.all import f, mutate, filter, if_else, tibble
from pipda import options
options.assume_all_piping = True
df = tibble(
x=range(4),
y=['zero', 'one', 'two', 'three']
)
df >> mutate(z=f.x)
# However, without source code available, we can't have both of the above and below work:
# mutate(df, z=f.x) |
thanks a lot for making it all clear! is there a way to pip install the dev branch of the module to already have the 9bd9d02 revision? I'm new to github The question is simply out of curiousity, everything works for me now that I installed ipython 🍪 |
You can do:
But I don't recommend it. It's still in development and may need more tests. |
* Make sure assume_all_piping mode works internally: #45 * Add ToothGrowth dataset * Change datasets.all_datasets() to datasets.list_datasets() * Make dataset names case-insensitive; add datasets economics, economics_long, faithful, faithfuld, luv_colours, midwest, mpg, msleep, presidential, seals, txhousing * 0.4.3 * Add `base.complete_cases`
Closeing. As 0.4.3 is now able run the |
* 📝 Add documentation for the "blind" environments (#45, #54, #55) * 🩹 Fix trimws not importable from datar.all/datar.base * ✨ Make as_date() return pd datetime types; Add as_pd_date() as an alias of pd.to_datetime() (#56) * 🔖 0.5.1 * 🚨 Fix linting * 👷 Deploy the docs on dev branch as well * 💚 Fix docs deply in CI
seems that the pipe operator doesn't work when using datar in virtual anaconda environments.
here's a snippet of running the example code ran in anaconda prompt:
from datar.all import f, mutate, filter, if_else, tibble
df >> mutate(z=f.x)
mutate(df, z=f.x)
pandas 1.2.3
python 3.8.1
ps thanks a lot for the package, hopefully the issue can be closed soon :)
The text was updated successfully, but these errors were encountered: