当我打开Jupyter笔记本(以前是IPython)时,它默认为c:\ users \ username

我如何将其更改为另一个位置?

我想得到的时间花在单元格执行除了原始的输出从单元格。

为此,我尝试了%%timeit -r1 -n1,但它没有公开在cell中定义的变量。

%%time适用于只包含1条语句的cell。

In[1]: %%time
       1
CPU times: user 4 µs, sys: 0 ns, total: 4 µs
Wall time: 5.96 µs
Out[1]: 1

In[2]: %%time
       # Notice there is no out result in this case.
       x = 1
       x
CPU times: user 3 µs, sys: 0 ns, total: 3 µs
Wall time: 5.96 µs

最好的方法是什么?

更新

我已经在nbeextension中使用执行时间相当长一段时间了。这是伟大的。

更新2021 - 03

到目前为止,这是正确的答案。从本质上讲,%%time和%%timeit现在都像预期的那样工作。

我开始严重依赖IPython笔记本应用程序来开发和记录算法。这太棒了;但有些事情看起来应该是可能的,但我不知道该怎么做:

I would like to insert a local image into my (local) IPython notebook markdown to aid in documenting an algorithm. I know enough to add something like <img src="image.png"> to the markdown, but that is about as far as my knowledge goes. I assume I could put the image in the directory represented by 127.0.0.1:8888 (or some subdirectory) to be able to access it, but I can't figure out where that directory is. (I'm working on a mac.) So, is it possible to do what I'm trying to do without too much trouble?

我有木星/anaconda/python3.5。

我如何知道我的jupyter笔记本在哪个conda环境上运行? 如何从新的conda环境中启动jupyter ?

我想注释掉在Jupyter笔记本多行块,但不知道如何做到这一点在当前版本。 它曾经在一个下拉菜单中,但现在不存在了。 如何一次注释掉多行代码块?

这不是一个副本,因为在下面的链接给出的解决方案似乎不再工作: 如何在IPython笔记本中阻止注释代码?

Ctrl + /什么都不做。

我的Jupyter笔记本电脑安装了python 2内核。我不明白为什么。我可能在安装的时候搞砸了。我已经安装了python 3。我怎么能把它加到木星上? 下面是默认的Jupyter使用python3 -m install Jupyter安装并在浏览器中使用Jupyter notebook打开的截图:

我对Jupyter Notebook是新的,Jupyter Notebook和JupyterLab之间的关键区别是什么,建议我选择最好的一个,应该在未来使用。

我想包括在木星笔记本图像。

如果我做了以下操作,它就会起作用:

from IPython.display import Image
Image("img/picture.png")

但我想包括在markdown单元格和下面的代码给出一个404错误的图像:

![title]("img/picture.png")

我也试过

![texte]("http://localhost:8888/img/picture.png")

但我仍然得到相同的错误:

404 GET /notebooks/%22/home/user/folder/img/picture.png%22 (127.0.0.1) 2.74ms referer=http://localhost:8888/notebooks/notebook.ipynb

我试着按照Jupyter笔记本文档上的说明去做。

不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?

我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。

我想在浏览器中增加ipython笔记本的宽度。我有一个高分辨率的屏幕,我想扩大单元格的宽度/大小,以利用这个额外的空间。

谢谢!


编辑/回答:2017年5月

我现在使用jupyterthemes: https://github.com/dunovank/jupyter-themes

还有这命令:

jt -t oceans16 -f roboto -fs 12 -cellw 100%

这设置宽度为100%与一个漂亮的主题。