jupyter-notebook

Getting “ AttributeError: 'ImageData' object has no attribute 'data' ” in headless gym jupyter Python 2.7

心已入冬 提交于 2021-01-27 18:54:15
问题 I am trying to run gym in headless server and render the same in jupyter. Python version 2.7. I have started the jupyter using xvfb-run -a -s "-screen 0 1400x900x24" jupyter notebook Below is the Jupyte cell that I run. import matplotlib.pyplot as plt import gym from IPython import display %matplotlib inline env = gym.make('CartPole-v0') env.reset() plt.imshow(env.render(mode='rgb_array')) display.display(plt.gcf()) display.clear_output(wait=True) env.step(env.action_space.sample()) # take a

Jupyter notebook can't find kernel when run through /etc/rc.local

冷暖自知 提交于 2021-01-27 18:35:37
问题 I have a Jupyter Notebook server on an EC2 instance with python2 (default) and ITorch kernels. Everything works fine when run through SSH command line. The problem is that when I try to make this run at startup, the notebook server can't find ITorch kernel. I does work fine for python notebooks though. The error I get is a window saying Kernel not found I couldn't find a kernel matching iTorch. Please select a kernel: (python2) What I did was adding this line to /etc/rc.local /home/ubuntu

Split data into 3 column dataframe

廉价感情. 提交于 2021-01-27 17:36:38
问题 I'm having trouble parsing a data file into a data frame. When I read the data using pandas I get a one column data frame with all the information. Server 7.14.182.917 - - [20/Dec/2018:08:30:21 -0500] "GET /tools/performance/log/lib/ui-bootstrap-tpls-0.23.5.min.js HTTP/1.1" 235 89583 7.18.134.196 - - [20/Dec/2018:07:40:13 -0500] "HEAD / HTTP/1.0" 502 - ... I want to parse the data in three columns. I tried using df[['Server', 'Date', 'Address']] = pd.DataFrame([ x.split() for x in df['Server'

Requests.get showing different HTML than Chrome's Developer Tool

我是研究僧i 提交于 2021-01-27 13:15:38
问题 I am working on a web scraping tool using python (specifically jupyter notebook) that scrapes a few real estate pages and saves the data like price, adress etc. It is working just fine for one of the pages I picked out but when I try to scrape this page: sreality.cz (sorry, the page is in Czech but the actual content is not that important now) using reguests.get() I get this result: <!doctype html> <html lang="{{ html.lang }}" ng-app="sreality" ng-controller="MainCtrl"> <head> <meta charset=

Octave kernel for jupyter not working on windows 10

亡梦爱人 提交于 2021-01-27 12:22:55
问题 I tried to install the octave kernel for jupyter using pip (as suggested here https://github.com/calysto/octave_kernel). But I cannot choose the Octave kernel when creating a new notebook. It worked without problems on my Mac, so I guess it might be a Windows related issue. Does someone have any ideas, how I could fix or investigate the problem? Octave is installed. 回答1: Setting environmental variable OCTAVE_EXECUTABLE to C:\\Octave\\Octave-4.2.1\\bin\\octave-cli.exe and restarting the PC

. + tab AutoComplete not working in Jupyter Notebook

天涯浪子 提交于 2021-01-27 11:52:58
问题 So out of nowhere I seemingly cannot autocomplete methods using . + Tab in Jupyter Notebook. Currently running Jupyter 6.0.1 I've tried the following with no success: $ sudo easy_install readline conda install -c anaconda jedi & updated conda and the following pip install pyreadline thanks! 来源: https://stackoverflow.com/questions/60066265/tab-autocomplete-not-working-in-jupyter-notebook

What is the correct way to update Jupyter Notebook extensions?

二次信任 提交于 2021-01-27 07:20:41
问题 What is the correct way to upgrade Jupyter Notebook extensions (e.g. RISE, ipywidgets)? I have a routine which keeps my Python packages updated by running pip install --upgrade , and this downloads and installs new Notebook extension versions too, when they are available. Should I also run jupyter nbextension install --py --sys-prefix , and possibly even jupyter nbextension enable --py --sys-prefix for each of the Notebook extensions which pip gets a new package? Thanks 回答1: jupyter

What is the correct way to update Jupyter Notebook extensions?

别等时光非礼了梦想. 提交于 2021-01-27 07:15:29
问题 What is the correct way to upgrade Jupyter Notebook extensions (e.g. RISE, ipywidgets)? I have a routine which keeps my Python packages updated by running pip install --upgrade , and this downloads and installs new Notebook extension versions too, when they are available. Should I also run jupyter nbextension install --py --sys-prefix , and possibly even jupyter nbextension enable --py --sys-prefix for each of the Notebook extensions which pip gets a new package? Thanks 回答1: jupyter

Save html of a Jupyter notebook from within the notebook

空扰寡人 提交于 2021-01-27 06:34:33
问题 My Jupyter workflow for exploratory analysis looks like: Fiddle with some parameters. Run the notebook; generate output. Eyeball outputs. Repeat. Can anyone suggest a command to make the notebook to save a copy of itself (e.g as an html in the output folder), so that if I want to recreate a particular experiment (results from a particular parameter set) I can do so? 回答1: Yes you can. Just add a safe cell by using cell magic. After using nbconvert you can rename the file and append a date %

Jupyter notebook cell stays busy (*) even after the execution is complete

你。 提交于 2021-01-27 06:20:52
问题 The Jupyter/IPython notebook started acting a little strange for my Ubuntu (14.04) computer. Usually, a cell in jupyter notebook becomes busy with an asterisk (*) symbol next to it when it is executed and as soon as the execution is busy, the execution sequence number is displayed to denote successful completion of whatever task which was in it. Now, whenever I execute a cell, it remains busy with an asterisk next to it even after the execution is complete. Then, any other cell which is given