jupyter-notebook

How to get active kernel name in Jupyter notebook

女生的网名这么多〃 提交于 2019-12-07 17:35:15
问题 I would like to make a notebook that prints the active kernel name. I registered multiple venvs as kernels using the python -m ipykernel install --user --name <kernel_name> In the notebook I would like to print some metadata about the active kernel. How can one get the name of the active kernel? EDIT: Here are the particular versions in my stack ipykernel==4.5.2 ipython==5.3.0 jupyter==1.0.0 nevertheless, the question should be answered in general. 回答1: One way to do this is using Javascript

Launch Dash from Jupyter Notebook

纵饮孤独 提交于 2019-12-07 17:02:29
Is there a way I can launch a Dash dahsboard using the below line of code in Jupyter notebook? # if __name__ == '__main__': # app.run_server(debug=True) When I try to launch this I get an error. The only way to correct it is to set debug to false. But then the Dashboard does not update automatically when the data feeding the charts is altered. EDIT I just found out that a valuable GitHub user published the following library . This is the direct link to the respective repo . See his documentation and examples to implement it successfully within jupyter. It worked for me. DON'T understimate this

Error with embed_notebook, getting plotly to work on Jupyter

和自甴很熟 提交于 2019-12-07 16:39:20
问题 I am trying to have embedded R plotly charts in Jupyter I am following https://plot.ly/r/using-r-in-jupyter-notebooks/ But stuck at "Make sure that both pandoc.exe and pandoc-citeproc are available in your local python installation folder (or Jupyter environment if you have setup a separate environment)." I found the pandoc.exe and pandoc-citeproc. But not sure on where to copy those files. Based on the Anaconda Prompt my environment is C:\Users\myname\AppData\Local\Continuum\Anaconda2\ But

Different font settings for editing code and markdown cells in the Jupyter Notebook

点点圈 提交于 2019-12-07 15:59:00
问题 In the Jupyter notebook, I would like to use the regular Ubuntu font when editing markdown cells and UbuntuMono for code cells. I can change the fonts of both these cell types simultaneously by editing .jupyter/custom/custom.css like so: .CodeMirror pre { font-family: "Ubuntu Mono", monospace; font-size: 14pt; } I can also change the formatting of the headers in the markdown code cells: .cm-header { font-size: 110%; font-family: "Ubuntu"; } As well as how the text looks when rendered (after

Jupyter Notebook: no module named pandas

点点圈 提交于 2019-12-07 15:39:34
问题 I've searched through other questions but have not found anything that has helped (most just suggest you do install pandas with conda or pip). In my jupyter notebook I'm trying to import pandas ( import pandas as pd ) but I'm getting the following error: ModuleNotFoundError: No module named 'pandas' Some pertinent information: I'm using python3 I've installed pandas using conda install pandas My conda environment has pandas installed correctly. After activating the environment, I type python

Jupyter notebook autocomplete showing duplicate options

北战南征 提交于 2019-12-07 12:51:58
问题 Jupyter notebook's autocomplete seems working, but somehow it will show duplicate options for the method. For example below: For each possible options, drop down menu will show 2 identical choices. Why this happen and how to fix it? 回答1: Relevant Github issue: https://github.com/ipython/ipython/pull/10969 This should be fixed in Ipython 6.3 release (track milestone completion here: https://github.com/ipython/ipython/milestone/48) 来源: https://stackoverflow.com/questions/48009983/jupyter

Keras floods Jupyter cell output during fit (verbose=1)

早过忘川 提交于 2019-12-07 12:22:57
问题 When running keras model inside Jupyter notebook with "verbose=1" option, I started getting not single line progress status updates as before, but a flood of status lines updated at batch. See attached picture. Restarting jupyter or the browser is not helping. Jupyter notebook server is: 5.6.0, keras is 2.2.2, Python is Python 3.6.5 Please help. cell content: history = model.fit(x=train_df_scaled, y=train_labels, batch_size=BATCH_SIZE, epochs=EPOCHS, verbose=1, validation_data=(validation_df

Could not install pyzmq using apt,pip,pip3,easy_install etc any command

久未见 提交于 2019-12-07 12:11:57
问题 I tried everything but pyzmq package is not installing. It stops while trying wheel. I even reinstalled wheel but no result. I have already installed all basic prereq stuff. I even installed clang and go-lang but nothing works it even shows same error while installing Jupiter notebook too. 回答1: You need to install the dev version of the libcrypt package in Termux: apt install libcrypt-dev This version of the package includes the required crypt.h header file. Trying it out I dug out an old

Activate virtual environement and start jupyter notebook all in batch file

拟墨画扇 提交于 2019-12-07 11:19:38
问题 I created the following batch file: jupyter_nn.bat . Inside file I have: cd "C:\My_favorite_path" activate neuralnets jupyter notebook So the goal is to activate conda virtual environment and start jupyter notebook. For some reason this does not work. Window immediately shuts down. If I run this batch file from cmd, it only executes activate neulranets . I already tried pause and pause>nul and other voodoo dances. Any suggestions? Also this is for Windows 7. 回答1: You need to add CALL before

How to enable timing magics for every cell in Jupyter notebook?

梦想与她 提交于 2019-12-07 10:31:35
问题 The %%time and %%timeit magics enable timing of a single cell in a Jupyter or iPython notebook. Is there similar functionality to turn timing on and off for every cell in a Jupyter notebook? This question is related but does not have an answer to the more general question posed of enabling a given magic automatically in every cell. 回答1: A hacky way to do this is via a custom.js file (usually placed in ~/.jupyter/custom/custom.js ) The example of how to create buttons for the toolbar is