Running this python script
%%time
train_data = dt.fread('../input/prediction/train.csv').to_pandas()
The provided output returns this error:
UsageError: Line magic function `%%time` not found. Suggest some approach.
%%time
is a 'cell magic' and has to be the first thing in the IPython (Jupyter) cell. I can reproduce this error if for example I have a comment first. When %%time
is not the first thing in the cell, IPython tries to interpret it as a 'line magic' hence the error you see.
I took a quick look in the documentation and it's not made explicitly clear there as far as I can see.
%%time
was the first thing in the cell and after going through the documentation i found %%time
is now updated with %time
You have to use %%time at top line of the cell in a notebook. Else it would throw the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With