XD blog

blog page

magic command


2014-11-11 SQLite in a Notebook with Magic Commands

Whenever I need to use SQLite, most of the time, I don't use Python because I don't do it often enough to remember the syntax. I usually use SQLiteSpy. However, converting any result to a dataframe is impossible unless I copy paste the results somewhere. So I implemented some magic commands in pyensae you can see in the notebook SQL Magic Commands with SQLite in a Notebook.

2014-09-20 Magic command %%CS for IPython Notebook

The notebooks IPython offer a couple of magic command to run others language such %%R, %%octave or %%julia. I found one option for F# but nothing on something like %%CS. However, magic commands are quite easy to handle. It is not that difficult to add one which allows me to do that:

%%CS mypower System.dll
public static double mypower(double x, double y)
{
    if (y == 0) return 1.0 ;
    return System.Math.Pow(x,y) ;
}

To be able to call it that way:

mypower(3.0,3.0)

more...

Xavier Dupré