Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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_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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: