jupyter-notebook

sys.path and sys.executable is incorrect in jupyter, but no applied fix is working

a 夏天 提交于 2021-01-28 07:52:35
问题 I've configured jupyter to be used from a remote computer and set a password to it while initial anaconda setup. Then after fixing this issue, I am trapped in another one. sys.path and sys.executable is incorrect in jupyter , but correct in python and ipython . Please see the details below. Anaconda3 is installed for all users in /opt/anaconda3 and I am using an environment zud for my programs. Background Once the above-mentioned problem is fixed, I tried to import igraph in jupyter but it

Why does this D3 code not produce any output in Jupyter Notebook?

瘦欲@ 提交于 2021-01-28 07:32:26
问题 I followed this blog here and here's the code that I'm trying to run on my Jupyter Notebook - essentially a simple scatter plot from the iris dataset. from IPython.core.display import display, HTML from string import Template import pandas as pd import json, random HTML('<script src="./d3.min.js"></script>') filename = 'https://gist.githubusercontent.com/mbostock/3887118/raw/2e68ffbeb23fe4dadd9b0f6bca62e9def6ee9e17/data.tsv' iris = pd.read_csv(filename,sep="\t") iris_array_of_dicts = iris.to

Is there a way to fix jupyter notebook css to allow page breaks?

泄露秘密 提交于 2021-01-28 07:09:40
问题 I want to generate a pdf from a custom-formatted jupyter notebook. I have managed to do that with in two steps: jupyter nbconvert --to html mynotebook.ipynb Using chrome to-pdf-print chrome --headless --to-pdf-print=mynotebook.pdf mynotebook.html I prefer to stick to the HTML/CSS stack - rather than LaTeX - as this gives the best results for graphs. Now, the one thing that I can't get to work is to add page breaks using CSS page-break-before . This issue in the nbconvert project mentions that

Overwrite string in for loop in Jupyter Lab Output widget

我只是一个虾纸丫 提交于 2021-01-28 06:47:39
问题 I am trying to create a sort of survey using Jupyter widgets. As a bare-bone example, I would like to ask the user if he likes a kind of fruit in a list, let him check yes/no in a RadioButtons widget, let him submit his answer, and then ask him if he likes the next fruit. I would expect something like this: Do you like apples? * yes * no Submit After pressing Submit , the apples string would be substituted by the next fruit in the list: Do you like oranges? * yes * no Submit What I am getting

AttributeError: 'property' object has no attribute '__name__'

大城市里の小女人 提交于 2021-01-28 06:26:08
问题 While I am importing the pandas in my data science project I am getting such kind of error. Does anyone know what might cause this? I tried with re-installation of pandas and python also I also tried with wheel import numpy as np import pandas as pd AttributeError Traceback (most recent call last) <ipython-input-2-b231533e2331> in <module> 1 import numpy as np ----> 2 import pandas as pd 3 from imblearn.over_sampling import SMOTE 4 from sklearn.model_selection import train_test_split 5 from

How can I add Actions to the tool-bar in the Dashboard of Jupyter Notebook?

做~自己de王妃 提交于 2021-01-28 06:13:04
问题 I'm creating a custom front-end extension for Jupyter Notebook. The actions will be triggered via buttons in the Notebook Dashboard and the Notebook Editor. The extension will affect single or multiple files (like the already existing "Move", "Duplicate", etc -Buttons do). So the resulting button might look like this: I can already place buttons in the tool-bar of the Notebook Editor, thanks to this tutorial, but I'm still unable to add actions to the toolbar in the Dashboard. How can I add

Jupyter Notebook - install python 2

百般思念 提交于 2021-01-28 05:07:30
问题 EDITED I'm very new to python and have a probably super basic question. I've installed Jupyter Notebook by installing anaconda which includes python 3 by default. Now I want to use an external toolbox which still works with python 2.7, so I'm trying to get e kernel with python 2.7 as suggested here. In the Anaconda Prompt I'm typing python2 -m pip install ipykernel python2 -m ipykernel install --user But it says that it couldn't find the command "python2". Any idea? 回答1: I had the same issue.

Pandas Column/Index Values With Dollar Signs

落花浮王杯 提交于 2021-01-28 04:53:38
问题 Given the following data frame: import pandas as pd df=pd.DataFrame({'A':['$0-$20','$20+']}) df A 0 0−20 1 $20+ How can I get the first value (0-20) to display with the dollar signs, as I originally specified? It actually displays the zero in a strange font and I'm not sure why it works for "$20+" but not "$0-"$20". I've tried: df=pd.DataFrame({'A':[str('$0-$20'),'$20+']}) ...but no dice. Here's specifically what I get: I'm using the Jupyter notebook (Anaconda 3, Python 3.5) Thanks in advance

Jupyter: Programmatically Clear Output from all Cells when Kernel is Ready

ε祈祈猫儿з 提交于 2021-01-28 04:45:31
问题 I have a question on how to programmatically clear\clean the output from all the Cells in my Jupyter notebook after notebook is done loading (when Kernel is ready), and prior to the user, myself, manually executing code. Basically, I would like the notebook to look clean when it is done loading, and I would like to do it automatically. How can I impose a command like clear_output() from a single initialization cell on to all other cells in the notebook? Thank you. 回答1: For a trusted notebook

Jupyter: Programmatically Clear Output from all Cells when Kernel is Ready

孤者浪人 提交于 2021-01-28 04:27:41
问题 I have a question on how to programmatically clear\clean the output from all the Cells in my Jupyter notebook after notebook is done loading (when Kernel is ready), and prior to the user, myself, manually executing code. Basically, I would like the notebook to look clean when it is done loading, and I would like to do it automatically. How can I impose a command like clear_output() from a single initialization cell on to all other cells in the notebook? Thank you. 回答1: For a trusted notebook