3 ms·
I've used this recipe in my IPython launch script to define SQL-like infix operators for working with pandas DataFrames. You can see that source here: < https:/
by p4wnc6 11y ago
I've used this recipe in my IPython launch script to define SQL-like infix operators for working with pandas DataFrames. You can see that source here: < https://github.com/spearsem/configs/blob/master/ipython_configs/profile_default/launch.py#L397 https://github.com/spearsem/configs/blob/master/ipython_conf... >.
You can scroll up a little for some of the other definitions.
This is just toy code of course, but it's fun sometimes to be able to say something like
SELECT * FROM>> dfrm <<WHERE>> COL('A') < 0.5
for a DataFrame "dfrm" with a column "A"
I like the "<< _ >>" syntax better myself, even though the "|_|" syntax uses fewer characters.