jupyter-notebook

Jupyter Notebook from command line - ImportError - cannot import name 'TYPE'

夙愿已清 提交于 2020-01-06 04:45:06
问题 Traceback (most recent call last): File "/Users/codymitchell/Documents/code/py/zipline/venv/bin/jupyter-notebook", line 6, in <module> from notebook.notebookapp import main File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/notebook/__init__.py", line 25, in <module> from .nbextensions import install_nbextension File "/Users/codymitchell/Documents/code/py/zipline/venv/lib/python3.5/site-packages/notebook/nbextensions.py", line 610, in <module> from

Import PySpark packages with a regular Jupyter Notebook

烂漫一生 提交于 2020-01-06 02:51:13
问题 What is pyspark actually doing except importing packages properly? Is it possible to use a regular jupyter notebook and then import what is needed? 回答1: Yes, it is possible but can be painful. While Python alone is not an issue and all you need is to set $SPARK_HOME , add $SPARK_HOME/python (and if not accessible otherwise $SPARK_HOME/python/lib/py4j-[VERSION]-src.zip ) PySpark script handles JVM setup as well ( --packages , --jars --conf , etc.). This can be handled using PYSPARK_SUBMIT_ARGS

Tensorboard doesn't show scalars anymore

久未见 提交于 2020-01-05 08:08:33
问题 I decided to update tensorboard because it wasn't showing the graph, on the graph panel all I could see was a blank page with no error message. Now that I have updated the graph, is the only thing my tensorboard shows. Now I cannot see scalars or histograms. I have the: No scalar data was found. message, and the same for histograms etc. This is the relevant parts of my code: def train_model(self): with tf.Session(graph=self.graph) as session: session.run(tf.global_variables_initializer())#Now

Dynamic port forwarding fails after turning off and on Google Cloud virtual machine (compute engine)

会有一股神秘感。 提交于 2020-01-05 07:35:31
问题 I'm connecting to my Spark cluster master node with dynamic port forwarding so that I can open jupyter notebook web interface in my local machine. I followed the instructions from this Google Cloud Dataproc tutorial: https://cloud.google.com/dataproc/docs/tutorials/jupyter-notebook I created ssh funnel with the following command as advised: gcloud compute ssh --zone=<cluster-zone> --ssh-flag="-D" --ssh-flag="10000" --ssh-flag="-N" "<cluster-name>-m" And opened web interface: <browser

How to import functions of a jupyter notebook into another jupyter notebook in Google Colab

只愿长相守 提交于 2020-01-05 07:24:11
问题 I would like to import functions of a Jupyter notebook (ending .ipynb) into another Jupyter notebook. Both notebooks are located in Google Drive in the same file. The notebook in which the functions of the other notebook should be imported, is already open in Google Colab. Therefore I'm looking for a code snipped like from xxx.ipynb import functionX I have already installed the PyDrive wrapper and authenticated and created the PyDrive client like follows: !pip install -U -q PyDrive from

Import new code into Jupyter Lab

喜你入骨 提交于 2020-01-05 07:09:32
问题 I am importing some python functions into a Jupyter Lab notebook and then using them within the notebook. But I am going back and forth between making alterations to the functions and then rerunning them in the Jupyter Lab notebook. The only way I have found to get Jupyter Lab to use the updated code is to restart the kernel and then rerun everything. While this works fine, it is a bit cumbersome because I need to run everything in the notebook again. Is there a better way to allow Jupyter

How to add widgets to container widget in ipython/jupyter

╄→尐↘猪︶ㄣ 提交于 2020-01-05 06:33:49
问题 I am trying to make VBox widget and and add a new row with text when button is clicked. I try the following code import ipywidgets as wg from ipywidgets import Layout from IPython.display import display vb = wg.VBox([wg.Text('1'),wg.Text('2')]) btn = wg.Button(description = 'Add') def on_bttn_clicked(b): vb.children=tuple(list(vb.children).append(wg.Text('3'))) btn.on_click(on_bttn_clicked) display(vb, btn) list(hb.children) But the assignment "hb.children=" does not work... Is there a way to

How to add widgets to container widget in ipython/jupyter

泪湿孤枕 提交于 2020-01-05 06:33:28
问题 I am trying to make VBox widget and and add a new row with text when button is clicked. I try the following code import ipywidgets as wg from ipywidgets import Layout from IPython.display import display vb = wg.VBox([wg.Text('1'),wg.Text('2')]) btn = wg.Button(description = 'Add') def on_bttn_clicked(b): vb.children=tuple(list(vb.children).append(wg.Text('3'))) btn.on_click(on_bttn_clicked) display(vb, btn) list(hb.children) But the assignment "hb.children=" does not work... Is there a way to

How to split columns and merge them as rows? [duplicate]

ⅰ亾dé卋堺 提交于 2020-01-05 04:15:11
问题 This question already has answers here : How to melt 2 columns at the same time? (2 answers) Closed 8 months ago . I have a data frame as follows: ID Date ColA1 ColB1 ColA2 ColB2 ColA3 ColB3 id1 date1 1 2 3 4 5 6 id2 date2 7 8 9 10 11 12 How can I split the columns ColA2 , ColB2 , ColA3 , ColB3 and merge them again to the dataset as rows (considering the ID and Date columns)? Expected output: ID Date ColA ColB id1 date1 1 2 id1 date1 3 4 id1 date1 5 6 id2 date2 7 8 id2 date2 9 10 id2 date2 11

How do I get HoloViews to display in Google Colabs notebooks?

江枫思渺然 提交于 2020-01-05 03:47:27
问题 I can't get any HoloViews graphics to display in any Google Colabs notebook. For example even the simple Bokeh example right out fo the HoloViews introduction points = hv.Points(np.random.randn(500,2)) points.hist(num_bins=51, dimension=['x','y']) fails to show anything, without any error being reported, while the same code (and all example code from HoloViews) works fine in local Jupyter notebooks. If I download the Colabs notebook locally and open it, I see the following where I say nothing