jupyter-notebook

pywintypes.error: (50, 'GetFileSecurity', 'The request is not supported.') while using Jupyter Notebook on network drive

笑着哭i 提交于 2019-12-19 10:32:24
问题 I am currently trying to use a combination of miniconda + jupyter (installed with pip) on a network drive and I get the following error: pywintypes.error: (50, 'GetFileSecurity', 'The request is not supported.') I am currently working in a corporate set-up, so we are working with some limitations regarding access rights. Unfortunately, I can only try jupyter on network drives, changes to the local hard drive requires admin rights which I don't have. The full error output: Traceback (most

Reading Multiple S3 Folders / Paths Into PySpark

拥有回忆 提交于 2019-12-19 10:28:21
问题 I am conducting a big data analysis using PySpark. I am able to import all CSV files, stored in a particular folder of a particular bucket, using the following command: df = sqlContext.read.format('com.databricks.spark.csv').options(header='true', inferschema='true').load('file:///home/path/datafolder/data2014/*.csv') (where * acts like a wildcard) The issues I have are the following: What if I want to do my analysis on 2014 and 2015 data i.e. file 1 is .load('file:///home/path/SFweather

Imbed matplotlib figure into iPython HTML

瘦欲@ 提交于 2019-12-19 10:12:37
问题 I want to dynamically write and display HTML with a code cell in Jupyter Notebook. The objective is to generate the HTML to display table, div, img tags in some way I choose. I want to capture img data and place it where I want in this auto generated HTML. So far I've figured out that I can do the following: from IPython.core.display import HTML HTML("<h1>Hello</h1>") and get: Hello That's great. However, I want to be able to do this: HTML("<h1>Hello</h1><hr/><img src='somestring'/>") and get

Jupyter Notebook in virtual environment doesn't see the virtual env packages

南楼画角 提交于 2019-12-19 05:24:19
问题 I'm trying to use a Jupyter Notebook in a virtual environment. I have created a new virtualenv virtualenv ker12 + activate + installed a specific version of keras or any other library. also as mentioned in Using a virtualenv in an IPython notebook I did: pip install ipykernel and python -m ipykernel install --user --name=my-virtualenv-name when I run the notebook and write ! which jupyter the output is correct /Users/myname/virtualenv/ker12/bin/python but when I try to import a library, for

What is the use of Jupyter Notebook cluster

末鹿安然 提交于 2019-12-19 04:14:24
问题 Can you tell me what is the use of jupyter cluster. I created jupyter cluster,and established its connection.But still I'm confused,how to use this cluster effectively? Thank you 回答1: With Jupyter Notebook cluster, you can run notebook on the local machine and connect to the notebook on the cluster by setting the appropriate port number. Example code: Go to Server using ssh username@ip_address to server. Set up the port number for running notebook. On remote terminal run jupyter notebook --no

Plotly icreate_animations offline on Jupyter Notebook

落花浮王杯 提交于 2019-12-19 03:12:33
问题 I am trying to replicate this plotly tutorial on a Jupyter Notebook with a dataset that matches the one given in the example, I just had to change the name of one column. The issue here is that being offline the command py.icreate_animations(figure) which in offline notebook mode becomes icreate_animations(figure) is not recognized. Furthermore, if I simply try the iplot(figure) command, which I use for static plots, a very long error is raised: -----------------------------------------------

Pandas: How to reference and print multiple dataframes as HTML tables

不想你离开。 提交于 2019-12-18 19:08:55
问题 I'm trying split out individual dataframes from a groupby to print them as pandas HTML tables. I need to reference and render them individually as tables so I can screenshot them for a presentation. This is my current code: import pandas as pd df = pd.DataFrame( {'area': [5, 42, 20, 20, 43, 78, 89, 30, 46, 78], 'cost': [52300, 52000, 25000, 61600, 43000, 23400, 52300, 62000, 62000, 73000], 'grade': [1, 3, 2, 1, 2, 2, 2, 4, 1, 2], 'size': [1045, 957, 1099, 1400, 1592, 1006, 987, 849, 973, 1005

How do I make matplotlib work in AWS EMR Jupyter notebook?

*爱你&永不变心* 提交于 2019-12-18 18:50:42
问题 This is very close to this question, but I have added a few details specific to my question: Matplotlib Plotting using AWS-EMR jupyter notebook I would like to find a way to use matplotlib inside my Jupyter notebook. Here is the code-snippet in error, it's fairly simple: notebook import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.show() I chose this snippet because this line alone fails as it tries to use TKinter (which is not installed on an AWS

Jupyter Notebook, Python: How to call a magic from within a function?

耗尽温柔 提交于 2019-12-18 16:51:40
问题 I am using the Jupyter Notebook, and am trying to create a widget, based on a template found on Github. The template uses at some point the magic %%javascript . This works fine when directly pasted in the cells of the notebook. However when I tried to make a function out of the widget, having the %%javascript expression makes it returns the error: %%javascript SyntaxError: invalid syntax Anyone knows how to "convert" the magic command so that it can be invoked properly from within a function

Increase DPI of Matplotlib .show() in Jupyter Notebook

荒凉一梦 提交于 2019-12-18 12:27:13
问题 I'm using Matplotlib in a Jupyter Notebook to display an image of a map. The code looks like this: %matplotlib inline imgpath = './map.png' import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np from PIL import Image img = Image.open(imgpath) print(img.size) width, height = img.size # img.thumbnail((width * 2,height * 2), Image.ANTIALIAS) # resizes image in-place imgplot = plt.imshow(img) plt.savefig('test.png', dpi = 300) The problem is, although the plt.savefig(