Questions tagged [jupyter-notebook]

1

votes
0

answer
14

Views

EMR notebooks install additional libraries

I'm having a surprisingly hard time working with additional libraries via my EMR notebook. The AWS interface for EMR allows me to create Jupyter notebooks and attach them to a running cluster. I'd like to use additional libraries in them. SSHing into the machines and installing manually as ec2-us...
Walrus the Cat
1

votes
1

answer
17

Views

How to Compare Elements in itertools.combinations?

I want to compare the elements in two series. 0 1 1 3 2 4 3 2 4 4 Name: s1, dtype: int32 0 3 1 3 2 0 3 5 4 1 Name: s2, dtype: int64 In order to compare the series easily, I used itertools.combinations : x = combinations(s1, 2) y = combinations(s2, 2) and the result x :...
Jerry Chen
1

votes
2

answer
525

Views

Open jupyter notebook in a text editor

Is it possible to open a jupyter notebook in a text editor like sublime or atom, so that I can quickly edit some changes and then save back? I could not find anything related to it. Are there any extensions that open it?
Gaurav Kumar
1

votes
1

answer
868

Views

List running instances of jupyter lab

Jupyter notebook comes with the useful command: jupyter notebook list which outputs all the running server instances for the current user. Besides it lists the relevant access tokens. Jupyter lab seems not to have this feature. Cruising through the jupyter lab manual I could not find the analogous...
Acorbe
1

votes
2

answer
655

Views

Failed to start the kernel on jupyter notebook

I have python versions 3.6.5_1 and 3.7.0installed via Homebrew. jupyter needs python3.6 for launching. It wouldn't start if I switch to python3.7. After launching, it fails to start the kernel. Giving this error: Traceback (most recent call last): File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vend...
nac001
1

votes
2

answer
17

Views

How to Count the Number of Column Labels Named With Numbers?

I want to count the number of columns with number-named label. movie_id 1 2 5 6 7 10 12 13 borda rank 0 1 5 4 4 4 0 4 0 3 24 1 1 2 3 0 3 0 0 0 0 3 9 3 2 3 4 0 0 0 0 0 0 0 4 4 3 4 3 0...
Jerry Chen
0

votes
0

answer
3

Views

Blas GEMM launch failed [Tensorflow-GPU]

I'm trying to train LSTM network for sequence to sequence task using tensorflow-gpu and no other library like keras on top of it. Whenever begin the training process i get this annoying error. Blas GEMM launch failed : a.shape=(128, 532), b.shape=(532, 1024), m=128, n=1024, k=532 [[{{node rnn/while/...
deepak nandwani
0

votes
0

answer
5

Views

Jupyter & Python: Why can't a child's call to a parent method recognize the parent's import?

In my current working directory I have the files active.ipynb which contains class B, subclass of A, and I have A.py where A is defined. When I'm defining everything within the notebook (i.e. class A and B are both defined within a cell in the notebook), everything works fine which is what I expect...
user526592
0

votes
0

answer
6

Views

RRuntimeError: Error in UseMethod(“predict”) :(when i try to call a function(which reads a rpart model and tries to predict)in R from python)

I have been trying to call a function in R from Python. When calling I'm getting an error saying that there's no applicable method 'predict' for the object 'rpart' I have tried importing rpy2 package and tried to call it but still I'm getting the same error def function(arg1,arg2,arg3,arg4, arg5,ar...
Ganesh Gs
1

votes
2

answer
1.4k

Views

two factor authentication with username and password for a Jupyter Notebook server

I've setup a Jupyter Notebook server with appropriate password and SSL so it is accessed via HTTPS. However, I'm looking now for a way to enforce a two factor authentication with username and password for loging in. The current Jupyter Notebook server only asks for a password and I hence have to cre...
matheo71
-1

votes
0

answer
16

Views

When I merge dataframes using columns as a key, it repeats the other columns infinite times

The problem looks like this. I'm not sure why the columns keep repeating. I've tried merging on='company_id' and how='left' but it just won't work.
King Alandy Dy
1

votes
1

answer
359

Views

Error while saving file: Unable to open database file

I am running Ipython notebook hosted on remote AWS EC2 image on RHEL. I am accessing the notebook from local browser using port forwarding between 2 systems which worked perfectly fine for first few days. Now, I am running into the following error messages when launching notebook: > [E 20:34:57.072...
Abhi
1

votes
2

answer
1.4k

Views

How can I view how much time each cell took to run in a Jupyter notebook?

After I select run all, run all above, or run all below in a Jupyter notebook, how can I view how much time each cell took to run? My question is different from Simple way to measure cell execution time in ipython notebook as I want the running times for all cells, not just one. I.e., if the noteboo...
1

votes
1

answer
3.8k

Views

Removing special characters in a pandas dataframe

I have found information on how this could be done, but nothing has worked for me. I am trying to replace the special character 'ð'. I imported my data from a csv file and I used encoding='latin1' or else I kept getting errors. However, a simple DF['Column'].str.replace('ð', '') will not do the tr...
SKlein
1

votes
3

answer
1.1k

Views

How to clean iPython environment so I can start over with Jupyter and Python 3.x?

Over the past couple years I've pip installed lots of things without knowing what I was doing. All of a sudden, I am getting this error when I run a snippet in a Python 2.7 Jupyter Notebook: ImportError: No module named matplotlib When I run this in Terminal: which -a python python 3... I get: Sams-...
samthebrand
1

votes
1

answer
976

Views

How to generate x axis values from a dataframe column in matplotlib?

Using jupyter notebook, I am reading in census data about baby names from a Google Sheet, and importing matplotlib.pyplot import pandas as pd Baby_Names_DF = pd.read_clipboard() %matplotlib inline import matplotlib.pyplot as plt I then execute the pandas dataframe Baby_Names_DF then I execute this B...
Danny
0

votes
0

answer
3

Views

How to run a “start-up” code when launching IPython (aka Jupyter) notebook?

In every notebook I launch do data analysis, I need to import several libraries (e.g. matplotlib, numpy, etc) Is there a way to have those imports automatically executed for every IPython kernel I launch? so I don't have to type them every time?
motam79
1

votes
1

answer
1.8k

Views

jupyter notebook installation issue using pip

I had a problem with jupyter notebook. Every time I started a notebook, kernel died. So, I decided to uninstall jupyter notebook using pip: pip uninstall jupyter notebook After successful uninstallation, I installed again, using same pip: pip install jupyter notebook Then, as usually, I typed in cmd...
James Wonder
0

votes
1

answer
24

Views

Problems with relative path import in python [duplicate]

This question already has an answer here: How to resolve “ValueError: attempted relative import beyond top-level package” 1 answer I have a project with this directory structure I want to import a def from functions.py from notebook01.ipynb. I followed the documentation of relative path import...
Mohammad ElNesr
1

votes
0

answer
8

Views

python plotly bar chart grouped and stacked in Jupyter-nb

I want to paint a bar chart where I can see 2 different levels in the same group, for example: |pd.dataframe|category| col1 | col2 | | 1 | row 1 | 3 | 7 | | 1 | row 2 | 2 | 5 | | 2 | row 1 | 2 | ... | I would like to plot in the same...
Krakenudo
1

votes
1

answer
1.3k

Views

Change seaborn pair plot figure size

I have the following code sns.pairplot(data=train, x_vars=['x'], y_vars=['y']) plt.show() and I am programming in jupyter notebook if that makes any difference, I want to plot a much larger figure of the plot but I cannot do it. I search the internet and the documentation mention to use the height...
JDOE
1

votes
1

answer
517

Views

Failing to start Jupyter Notebook : 'does not appear to be an IPv4 or IPv6 address'

I am not able to start the Jupyter Notebook (Installed using Anaconda 4.5.11) configured to run a remote VM (Redhat Enterprise Linux 6.x). The 'jupyter_notebook_config.py' has the following property configured: c.NotebookApp.ip = '*' The error returned is the following: During handling of the above...
Arnab Biswas
1

votes
1

answer
775

Views

Jupyter Notebook - Plot inside a function - Figure is not plotted [duplicate]

This question already has an answer here: Plot won't show in Jupyter 1 answer I want to call a function from a class in which I want to plot several figures. There is no error thrown but I did not receive the plot but only: ############################################# Histograms of the continuous...
2Obe
1

votes
1

answer
66

Views

Gradle dependencies for Jupyter notebook

I'm writing Java code in a Jupyter Notebook via IJava . I want to add external dependencies such as OpenCSV. Using gradle, this would normally be incorporated in the build.gradle file via the line compile 'com.opencsv:opencsv:4.3.2' How can I add dependencies at runtime via gradle in the Jupyter not...
Mark Teese
1

votes
2

answer
47

Views

What is the problem with my neural network which gives wrong predictions

So, i train my neural network with example train data from keras and then I feed it with my own hand-written digit in paint. import os import cv2 import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras mnist = tf.keras.datasets.mnist (x_train, y_train...
droomore
0

votes
1

answer
22

Views

Convert Object type to Float type

This goal is to convert the type from 'object' to 'float' from KDD 99 dataset. This is the information of the dataset : class 'pandas.core.frame.DataFrame' RangeIndex: 494020 entries, 0 to 494019 Data columns (total 42 columns): duration 494020 non-null int64 protocol_type...
David Reynaldo
1

votes
0

answer
10

Views

Is it possible to halt execution of a Jupyter notebook using papermill?

I have a set-up whereby I have a few Jupyter notebooks that are parameterised so I can run them from another notebook. I'm using the papermill module to do this which is quite convenient. The simplest way of running looks something like this path = '/path/to/notebook.ipynb' pm.execute_notebook( path...
mcansado
1

votes
3

answer
934

Views

unable to install ipython on mac

am using Mac El Capitan, I need to install iPython and have to use iPython notebook I use $ pip install ipython to install the ipython, but it return me Requirement already satisfied (use --upgrade to upgrade): ipython in /Library/Python/2.7/site-packages Requirement already satisfied (use --upgra...
Jasmeet
1

votes
2

answer
486

Views

NameError: name 'Pkg' is not defined

In the IJulia Notebook I'm trying to add the packages, but I'm getting the error: NameError: name 'Pkg' is not defined
Mona Jalal
1

votes
1

answer
136

Views

Unexpected behavior from 'table.extract()' in Google datalab jupyter BigQuery notebook

I'm studying the datalab jupyter notebook tutorial ~/datalab/tutorials/BigQuery/'Importing and Exporting Data.ipynb'. I'm having trouble understanding the behavior of: table.extract(destination = sample_bucket_object) The resulting csv of this extraction contains: Year,Make,Model,Description,Price...
Oof
1

votes
2

answer
175

Views

Python: beautify numerical and dict outputs

I'm doing a loop to output and compare the gof_train and gof_test: pp.pprint(gof_train) pp.pprint(gof_test) This would give me results like this (in an IPython Notebook): # gof_train {'Chi_square': 2835.3674597856002, 'K_S': 0.05029482196934898, 'MSE': 7.3741561732037447e-08, 'RMSE / Mean': 0.461935...
cqcn1991
1

votes
1

answer
3.8k

Views

Reset an IPython kernel without restarting

Is there a way of programmatically reset an IPython kernel without restarting it? Currently I am calling KernelManager.restart_kernel but that is quite slow. The purpose of this is to isolate unit tests in a py.test plugin for using Notebook cells as unit tests. If you have other ideas to achieve t...
Andrea Zonca
1

votes
2

answer
160

Views

register method missing in faulthandler

I'm getting the following error message while trying to kick off iPython's notebook: File "C:\Python34\lib\site-packages\ipykernel\kernelapp.py", line 326, in patch_io faulthandler_register = faulthandler.register AttributeError: 'module' object has no attribute 'register' This is under Python 3.4....
Dmitry B.
1

votes
3

answer
1.6k

Views

Import PySpark packages with a regular Jupyter Notebook

What is pyspark actually doing except importing packages properly? Is it possible to use a regular jupyter notebook and then import what is needed?
Cedric H.
-1

votes
1

answer
24

Views

Jupyter notebook carriage return not working [duplicate]

This question already has an answer here: Printing on the same line on a jupyter notebook 2 answers I'm trying to print a progress bar using end=\r with print(), but the Jupyter notebook output still has new lines. for i in range(0, 100000): print(i, end='\r') Output: 2478 4867 6957 8970 11405 ......
Justin Zhang
0

votes
0

answer
6

Views

Can not start jupyter-notebook on remote ubuntu server

I am getting the following error when trying to start a jupyter notebook on a remote linux server (my_env) [email protected]:~$ jupyter notebook [E 13:30:16.638 NotebookApp] Exception while loading config file /home/chrisj/.jupyter/jupyter_notebook_config.py Traceback (most recent call last): File "/home...
ChrisJ
1

votes
0

answer
9

Views

Jupyter Kernel connection error: Path not found

When I try to launch a notebook the kernel can't connect and return this error: ImportError: cannot import name 'path' from 'IPython.external.path' (C:\Users\u557210\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\external\path\__init__.py) Where could I find this path package? Or how to...
Y Z
5

votes
1

answer
44

Views

Visualizing Text Classification

Suppose I have a sentence of words, where each word (or character) has an associated numeric value, or color. As an example, this could be coming from an RNN sentiment classifier, which would produce something like: I'm looking for a lightweight way of visualizing words/characters in sentences in Ju...
Alex R.
1

votes
0

answer
7

Views

Performant replacement for IPython !shell-command magic

On Google Colab, using: ! shell-command is extremely slooooooooooooooooooooow. Here's a test: import os %timeit os.system('date > /dev/null') %timeit ! date > /dev/null Gives output: 100 loops, best of 3: 8.58 ms per loop 1 loop, best of 3: 1.56 s per loop This makes using ! command 180 times slowe...
Tom Hale
1

votes
1

answer
38

Views

Conceptual Question : Python Modules, & File Imports, Importing functions from other files

I am a super n00b beginner, I have been teaching myself python concepts for the last couple of months using juptyer notebook, and lessons in CFD & similar subjects that I am conceptually familiar with. My background is Mechanical Engineering. In the lesson below I need to import functions from separ...

View additional questions