I made the switch to Emacs. I am using Elpy within Emacs as an IDE. My setup is side-by-side windows, on the left is a buffer(script) where I write/edit the code which then gets sent to the IPython shell on the right with Ctrl-Enter
. When I type the function:
import numpy as np
import pandas as pd
data = pd.read_csv('spx_index.csv')
def convert(x):
return x.ix[:, 1:].set_index(x.ix[:, 0])
into the script (4-space indentation) and press Ctrl-Enter
twice I get:
>>> ... File "<stdin>", line 2
return x.ix[:, 1:].set_index(x.ix[:, 0])
^
IndentationError: expected an indented block
However, when I copy the function and paste it directly into the IPython shell:
>>> def convert(x):
return x.ix[:, 1:].set_index(x.ix[:, 0])
... ...
>>>
It works and the function is saved.
Getting the function to run directly from the script to the shell would be ideal. I can't imagine having to copy and paste every function into the shell.