jupyter-notebook

Update a Bokeh Span with an interact element in Jupyter notebook

假装没事ソ 提交于 2021-01-28 04:03:46
问题 I am trying to make a span in bokeh using jupyter widgets. from ipywidgets import interact import numpy as np from scipy.stats import norm from bokeh.sampledata.daylight import daylight_warsaw_2013 from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from bokeh.models import Span output_notebook() p = figure() x_axis = np.arange(-10, 10, 0.001) # Mean = 0, SD = 2. y_axis = norm.pdf(x_axis,0,2) p.line(x_axis, y_axis, line_dash='solid', line_width=2)

R kernel crashes while loading R package using rpy2

一世执手 提交于 2021-01-28 03:45:37
问题 First of all, I’m new to rpy2 / jupyter so please don’t judge me if this isn’t the correct place to ask my question. I am trying to set up an integrated workflow for data analysis using R and Python and I encounter the following error: I am on Ubuntu 19.04. running a conda environment using Jupyter 1.0.0, Python 3.7.4, R 3.5.1, r-irkernel 1.0.2 and rpy2 3.1.0 and I installed the R-package Seurat through R. When I create a Jupyter notebook using the R-kernel, I can load Seurat with library

Update a Bokeh Span with an interact element in Jupyter notebook

房东的猫 提交于 2021-01-28 03:43:54
问题 I am trying to make a span in bokeh using jupyter widgets. from ipywidgets import interact import numpy as np from scipy.stats import norm from bokeh.sampledata.daylight import daylight_warsaw_2013 from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from bokeh.models import Span output_notebook() p = figure() x_axis = np.arange(-10, 10, 0.001) # Mean = 0, SD = 2. y_axis = norm.pdf(x_axis,0,2) p.line(x_axis, y_axis, line_dash='solid', line_width=2)

Import custom .py files in Jupyter Notebook for Anaconda3

末鹿安然 提交于 2021-01-28 03:03:57
问题 Where do I store custom .py files for Anaconda3 on Mac, so that I can import them as packages in Jupyter Notebook? 回答1: You can store them anywhere if you insert import os import sys sys.path.append(os.path.abspath("path/to/module.py")) from module import * 来源: https://stackoverflow.com/questions/50293427/import-custom-py-files-in-jupyter-notebook-for-anaconda3

How to run QT platform plugin on windows

百般思念 提交于 2021-01-28 02:49:01
问题 I use Anaconda3 5.2.0 and jupyter notebook(python3)(Window10) I made a file through 'pyinstaller'. But when I play file that I made, It has some Error.\ there are qwindows, qoffscreen, qminimal, qdirect2d .dall in platforms folder ============================================================================= qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized.

How to move Jupyter notebook cells up/down using keyboard shortcut?

◇◆丶佛笑我妖孽 提交于 2021-01-28 02:30:35
问题 Anyone knows keyboard shortcut to move cells up or down in Jupyter notebook? Cannot find the shortcut, any clues? 回答1: You can select the next cell (downwards direction) - Shift + J or Shift + Down key and select cells to upwards direction using Shift + K or Shift + Up key . EDIT: These short cuts I've tried windows only. For other OS, please refer to this source. 来源: https://stackoverflow.com/questions/62453756/how-to-move-jupyter-notebook-cells-up-down-using-keyboard-shortcut

How to automatically execute next cell even if an error occurs in the current cell in Jupyter?

断了今生、忘了曾经 提交于 2021-01-28 02:03:38
问题 I am running a cell in Jupyter notebook where an error is bound to occur after some time(usually hours). But even after this error occurs, I want the compiler to just move on to the next cell and run the remaining cells that I put in the queue to be run after this cell finishes. I know exceptions might be able to do this, but I wanted to know if there was any other way specific to Python or Jupyter notebook that might do the trick. Cell 1: Some code running # Error will occur here and stop

Running code cells sequentially in google colab

…衆ロ難τιáo~ 提交于 2021-01-28 00:40:18
问题 I want to run the code cells in Google Colab in sequence. For example: Cell[1] from catboost import CatBoostRegressor #do something here Cell[2] clf = CatBoostRegressor(task_type='GPU') #do some more things here But when I select "Run all" all cells seem to run in parallel, so my code does not work. When I do the same thing in a Kaggle Kernel it runs perfectly i.e, first cell[1] is executed, and then cell[2] and so on. I have tried searching for this in Google Colab but failed to come up with

tensorflow error utf-8 OS X Sierra

╄→гoц情女王★ 提交于 2021-01-27 20:35:24
问题 I've installed TensorFlow with Anaconda on OS X Sierra. I didn't´t have any problems during installation. Writing the tipical example: import tensorflow as tf a = tf.constant(5, name="input_a") b = tf.constant(3, name="input_b") c = tf.mul(a, b, name="mul_c") d = tf.add(a, b, name="add_d") e = tf.add(c, d, name="add_e") sess = tf.Session() output = sess.run(e) writer = tf.summary.FileWriter('./my_graph', sess.graph) writer.close() sess.close() The file is created in the appropriate folder,

keep the extra whitespaces in display of pandas dataframe in jupyter notebook

只愿长相守 提交于 2021-01-27 19:36:41
问题 In jupyter notebook, extra whitespaces in dataframe are removed. But sometime that is not preferred, e.g. df=pd.DataFrame({'A':['a b','c'],'B':[1,2]}) df The result I get: | | A | B | |---|-----|---| | 0 | a b | 1 | | 1 | c | 2 | But I want: | | A | B | |---|-------|---| | 0 | a b | 1 | | 1 | c | 2 | Is it possible? Thanks 回答1: It's actually HTML: pandas dutifully write all the spaces into the HTML markup (the front end format used by Jupyter Notebook). HTML, by default, collapses multiple