jupyter-notebook

Quandl not working in Jupyter Notebook (but working at command-prompt)

爷,独闯天下 提交于 2019-12-24 21:22:38
问题 I have already installed quandl library at command prompt using command: pip3 install quandl And I am able to use various quandl methods. But in my Jupyter Notebook, when I do "import quandl", it says: No module named 'quandl' I have restarted Jupyter notebook, even then the same results. Other modules like Numpy, Pandas, Matplotlib work fine for me at the command-prompt and also in Jupyter Notebooks. I have already gone through other posts mentioning the same issue, but all of them just

Plotly error: Invalid 'figure_or_data' argument

两盒软妹~` 提交于 2019-12-24 21:21:21
问题 an animation example from this plotly tutorial is not working with Plotly 2.0.12. I put the error output below. Is there any way to solve the problem? I am using plotly on a Jupyter Notebook. PlotlyError: Invalid 'figure_or_data' argument. Plotly will not be able to properly parse the resulting JSON. If you want to send this 'figure_or_data' to Plotly anyway (not recommended), you can set 'validate=False' as a plot option. Here's why you're seeing this error: 'slider' is not allowed in

Replace multiline existing output in python

纵然是瞬间 提交于 2019-12-24 20:43:30
问题 In python 3 , there have been answers about how to replace an existing output with another. These answers suggest the use of end='\r' ad in print('hello', end='\r') This is working ofcourse, but it works only for one line . In the program that I post below, I first output 5 lines which is the representation of a table matrix. The user is asked to type one number (1-3) and then the matrix is printed again with an 'X' in the position that the user indicated. But as you can see, the matrix is

Specify where in output matplotlib figures are rendered in jupyter using figure handles

自古美人都是妖i 提交于 2019-12-24 20:08:39
问题 When working with matplotlib, a common pattern for me is to figure in a function, return it, and let the caller decide what t do with it (render to screen, save to file etc...). In jupyter notebook, I want to call such a function in a loop, and make sure that figure output is in order. In this answer https://stackoverflow.com/a/53450873/4050510 , we learn that plt.show() can help us with randering images. A rewrite of that answer is: # cell 1 %matplotlib inline import matplotlib.pyplot as plt

Import encrypted csv into Python 3

强颜欢笑 提交于 2019-12-24 19:28:58
问题 So I am planning to do some data analysis using a Jupyter notbook (Python 3), for collaborative reasons I want to store the data on a github repo, however the data set is sensitive. As such I would like to store the data (currently .csv) as an encrypted file on the repo and then decrypt it at runtime (with a password prompt I guess). What is the best method to do this? 回答1: In the end, I used python 3.6 and SimpleCrypt to encrypt the file and then uploaded it. I think this is the code I used

Ipython Notebook & Matplotlib: How to wrap a plot within a html div?

ε祈祈猫儿з 提交于 2019-12-24 12:51:59
问题 I want to add some css to part of my plot, (specifically, I want to set float:left ). How can I produce the plot within a div, so I can use css to control its layout? For example, for code def simple_plot(ax = None): if ax is None: fig, ax = plt.subplots() a = [1,2,3,4] b = [3,4,5,6] plt.plot(a, b,'-', color='black') simple_plot() The default output html in Ipython Notebook is <div class="output_area"> <div class="prompt"></div> <div class="output_subarea output_png"> <img src="data:image/png

jupyter python notebook showing kernel error

六月ゝ 毕业季﹏ 提交于 2019-12-24 12:21:28
问题 I am accessing jupyterhub notebook through browser as it is running on a remote server(using nginx so that jupyterhub is accessible to client machines).When I access the notebook a kernel error is shown at the top of the screen. Jupyterhub and jupyter notebook is running on a kubernetes cluster and the jupyter notebook is a custom built docker image suitable for python programming. I am very new into python/jupyter hub/notebook, please suggest how to resolve the kernel error. 回答1: Please

Ipython notebook horizontal zoom

☆樱花仙子☆ 提交于 2019-12-24 12:15:27
问题 I have subplots in an ipython notebook. I can zoom in inline using the mpld3 module. However, right now I can only zoom into a rectangle. Due to my application's nature I need horizontal zoom. Is there a way to zoom horizontally (using your cursor) in matplotlib? Better yet can I set the zoom to be horizontal via code without any keyboard manipulation? In Matlab, I can do this by setting: figure(1); h=zoom; set(h,'Motion','horizontal','Enable','on'); Here is a minimal example in python:

How to concatenate three or more images vertically?

元气小坏坏 提交于 2019-12-24 11:24:02
问题 I try to concatenate three images vertically and I need some assistance with the code/function. So far I imported one image and cropped 3 smaller images with the same size. Now I want to concatenate them in one image that will be long, but narrow. However, I can't find an appropriate function or even if I find one I get an error message when I apply it to my code. I already tried to make a collection from my three pictures and then use the function skimage.io.concatenate_images(sf_collection)

How to set Jupyter Notebook iopub_data_rate_limit from Notebook?

亡梦爱人 提交于 2019-12-24 11:18:14
问题 I use several different machines regularly, so I typically have some notebook setting that I include with my import statements to avoid having to change configuration files all the time: from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) pd.set_option('display.max_colwidth', -1) pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) pd.options.mode.chained_assignment = None Now, I have encountered the