jupyter-notebook

Installing module from GitHub through Jupyter notebook

北城余情 提交于 2019-12-17 03:44:50
问题 My first time trying to install something from GitHub, but couldn't find a simple solution after searching here and on google. I'm using Jupyter notebook and trying to install this module: https://github.com/Expt-David/NumSchrodingerEq i've tried to write this inside the notebook: !pip install git+git://github.com/Expt-David/NumSchrodingerEq.git but i'm getting the following error: Collecting git+git://github.com/Expt-David/NumSchrodingerEq.git Cloning git://github.com/Expt-David

IOPub data rate exceeded in Jupyter notebook (when viewing image)

笑着哭i 提交于 2019-12-17 02:59:07
问题 I want to view an image in Jupyter notebook. It's a 9.9MB .png file. from IPython.display import Image Image(filename='path_to_image/image.png') I get the below error: IOPub data rate exceeded. The notebook server will temporarily stop sending output to the client in order to avoid crashing it. A bit surprising and reported elsewhere. Is this expected and is there a simple solution? (Error msg suggests changing limit in --NotebookApp.iopub_data_rate_limit .) 回答1: I ran into this using

Show DataFrame as table in iPython Notebook

安稳与你 提交于 2019-12-17 01:34:14
问题 I am using iPython notebook. When I do this: df I get a beautiful table with cells. However, if i do this: df1 df2 it doesn't print the first beautiful table. If I try this: print df1 print df2 It prints out the table in a different format that spills columns over and makes the output very tall. Is there a way to force it to print out the beautiful tables for both datasets? 回答1: You'll need to use the HTML() or display() functions from IPython's display module: from IPython.display import

Using IPython notebooks under version control

梦想与她 提交于 2019-12-17 01:14:30
问题 What is a good strategy for keeping IPython notebooks under version control? The notebook format is quite amenable for version control: if one wants to version control the notebook and the outputs then this works quite well. The annoyance comes when one wants only to version control the input, excluding the cell outputs (aka. "build products") which can be large binary blobs, especially for movies and plots. In particular, I am trying to find a good workflow that: allows me to choose between

Conda environments not showing up in Jupyter Notebook

末鹿安然 提交于 2019-12-16 22:59:13
问题 I installed Anaconda (with Python 2.7), and installed Tensorflow in an environment called tensorflow . I can import Tensorflow successfully in that environment. The problem is that Jupyter Notebook does not recognize the new environment I just created. No matter I start Jupyter Notebook from the GUI Navigator or from the command line within the tensorflow env, there is only one kernel in the menu called Python [Root] , and Tensorflow cannot be imported. Of course, I clicked on that option

Kill Spark Job programmatically

笑着哭i 提交于 2019-12-14 04:26:36
问题 I am running pyspark application through Jupyter notebook. I can kill a job using Spark Web UI, but I want to kill it programmatically. How can I kill it ??? 回答1: Suppose that you wrote this code: from pyspark import SparkContext sc = SparkContext("local", "Simple App") # This will stop your app sc.stop() As descibes in the docs: http://spark.apache.org/docs/latest/api/python/pyspark.html?highlight=stop#pyspark.SparkContext.stop 来源: https://stackoverflow.com/questions/43236330/kill-spark-job

Display flask app output in Jupyter notebook

醉酒当歌 提交于 2019-12-14 04:22:27
问题 I'm running a basic flask script from a jupyter notebook. I can access it through a web browser but the cell doesn't output the requests log unlike when the script is run from a commandline. Is there a way to display the log in the notebook. here is the script %load_ext ipyext.writeandexecute %%writeandexecute -i myflask myflask.py from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run() 回答1: Just in case others face

Conflicting python version in jupyter notebook(Conda)

情到浓时终转凉″ 提交于 2019-12-14 03:03:22
问题 I am trying to setup Jupyter notebook using Conda, but the python version being used by notebook is not the same as the Conda environment. I used the following command to create the 'python_jupyter' environment. conda create -n python_jupyter python=3.6.5 ipykernel But in the notebook, when I check the python version I get different results depending on how I am checking it. If I check using bash command I get the expected version number 3.6.5, but from python code, I get 3.6.3(which I am

Cannot install IRkernel with install_github(): Git not installed?

我们两清 提交于 2019-12-14 00:22:30
问题 I was trying to get R working with the Jupyter Notebook on my Windows machine. I followed the IRkernel tutorial. However, I can't install the GitHub repository, I always get the error install_github("IRkernel/IRkernel") Downloading GitHub repo IRkernel/IRkernel@master Error: Git does not seem to be installed on your system. The devtools package (2.0.1) is installed. install_github also works for example with install_github("StatsWithR/statsr") (Coursera package) (although the devtools package

How to plot bar chart when the columns of the data are each day of each month?

老子叫甜甜 提交于 2019-12-13 22:52:21
问题 I don't know how to plot the bar chart like this photo. Can anyone help me please? 回答1: The pandas command Series.plot.bar accepts a color keyword, where you can input a list of colors (in RGBA or color names). I'm not entirely sure on what logic does the command follow when the list is too short, but if the list is the right length, it'll work. Example: %matplotlib inline import pandas as pd this_series = pd.Series([0.5, 0.6, 0.1, 0.1, 0.05, 0.05, 0.7, 0.3, 0.2], name='foo') this_series.plot