It seems that Jupyter can't recognise them, but it's strange because my Jupyter actually uses the same IPython kernel as Spyder does. And as far as I tried, the command %%time and %%timeit both raise compilation error. In Jupyter code cells aren't defined by #%% delimiters, rather they are created by clicking a button in the menu bar. This is how things work in Spyder, but doesn't quite work in the Jupyter Notebook environment. Running the above code can get the runtime of the cell defined by the pair of #%%. #%% (the previous cell ends and the next begins) %%time # or %%timeit which measures average runtime from multiple runs It seems that in Spyder (IPython3 Kernel) one can easily time a code cell by running the %%time or %%timeit command at the top of the code cell: #%%
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |