python - Line magic function `%%time` not found

ID : 274556

viewed : 48

Tags : pythonjupytermagiclinepython





Top 4 Answer for python - Line magic function `%%time` not found

vote vote

92

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

vote vote

90

You have to use %%time at top line of the cell in a notebook. Else it would throw the error.

vote vote

80

%%time was the first thing in the cell and after going through the documentation i found %%time is now updated with %time

vote vote

67

Top 3 video Explaining python - Line magic function `%%time` not found







Related QUESTION?