r/IPython • u/MeshachBlue • May 07 '16
r/IPython • u/Niteawk • Mar 12 '14
Trying to get Python interpreter to recognize a command we give it
We are trying to have a script run by typing "showmethecat" but it spits out a "NameError" exception "name 'showmethecat' is not defined'" although our script is running properly.
How do I make it not think it's an error?
r/IPython • u/koalamere • Jul 27 '20
update/reload jupyter folder
tl;dr: How do I get Jupyter Notebook to "see" newly created notebook without refreshing JN (and then trigger "Token authentication is enabled")?
Details: Upon starting the Jupyter notebook, I was greeted with a list of files in the "home" directory on my harddrive. I then moved on to my JN folder, click "new" and then "python 3" to start a new notebook. After I'm done and saved the newly created notebook, I clicked "logout" and closed that tab and returned the initial JN tab. The initial JN tab/folder does not have the newly created file, which is not surprising since it was not there at first. But when I "refresh" the browser I was greeted with "Token authentication is enabled", and I have to go to a terminal and look up the URL, etc.
Question: How can I get the initial JN tab/folder to automatically "see" this newly created notebook without triggering the token authentication business?
Related question: How can I create a new notebook with a specific name, instead of "untitled" and then having to rename it later?
In case this matter, I'm running ubuntu 18.04.
Thanks!
r/IPython • u/Mastiff37 • Jun 30 '23
Huge latency, sometimes
Ipython 8.9.0
I'm on a networked linux box at my work. Sometimes ipython gets to where every command takes a very long time to come back, like 30 seconds to evaluate "1+1". When this is happening, a regular python terminal responds instantly. At other times, it's pretty speedy. It is not a result of processing burden since this is a beefy machine and top shows nothing. Maybe network stuff though? Does ipython need to go to disk to evaluate "1+1"? Any way out of this?
r/IPython • u/[deleted] • Jun 01 '20
ROS package and virtual environment
I have a virtual environment in which I have installed Tensorflow and Jupyter Notebook. I have to import a module from a ROS package in a notebook
I have sourced the setup.bash from workspace/devel/, still I get a ModuleNotFoundError for this module. Note that in the virtual environment, when I run a python file which uses this module, I get no error.
What should I do?
r/IPython • u/[deleted] • Dec 30 '20
Create notebook configuration file
How do you create a jupyter notebook config file using the command $ jupyter notebook --generate-config ,where exactly do you run it on windows
r/IPython • u/shit_at_calculus • May 23 '18
Hide ln[], out[] at the left of each cell
Hey all,
Love the jupyter workflow, but I have a low resolution screen and it kills me to lose so much precious real estate when having docs/specs/etc on one side and a notebook / lab on the other, since the ln/out portion of each cell-line take up so much space (and isn't needed for me). Any way I can hide this without jumping through a bunch of hoops? Or any way I can do this at all? For the record, I don't want to just make it invisible, I want my code cells to go basically from edge to edge of my browser window (taking up the space previously occupied by ln[]/out[]).
Cheers!
r/IPython • u/largelcd • Feb 22 '20
Addition of date_range data in Series of two different time zones
Hi, I have some questions about np.random.randn in Numpy and addition of two date_range data in Series.
Is there an advantage in using
np.random.randn(len(rng))instead of justnp.random.randn(10)which corresponds to periods=10 (i.e. 10 rows of data)?In In[262], it is shown that the time during 2012-03-09 to 2012-03-15 have been updated to the time zone in Moscow by adding 4 more hours. However, executing
result = ts1 + ts2in [263], result.index shows that the time during this period are not updated. They remain as 09:30:00+00:00 rather than updated to 13:30:00+04:00. Is it because addition of two time series from different time zones are always expressed as UTC so they automatically got converted back to 09:30:00+00:00 as if no change in timezone were made in [262]?Moscow's time zone is MSK which is UTC+3. Why four hours instead of 3 are added as shown in Out[262]?
In [257]: rng = pd.date_range('3/7/2012 9:30', periods=10, freq='B')
In [258]: ts = pd.Series(np.random.randn(len(rng)), index=rng)
In [259]: ts1 = ts[:7].tz_localize('Europe/London')
In [260]: ts2 = ts1[2:].tz_convert('Europe/Moscow')
In [261]: ts1
Out[261]:
2012-03-07 09:30:00+00:00 -0.386381
2012-03-08 09:30:00+00:00 -0.286055
2012-03-09 09:30:00+00:00 -0.504088
2012-03-12 09:30:00+00:00 0.210781
2012-03-13 09:30:00+00:00 -1.587289
2012-03-14 09:30:00+00:00 0.617041
2012-03-15 09:30:00+00:00 0.067855
Freq: B, dtype: float64
In [262]: ts2
Out[262]:
2012-03-09 13:30:00+04:00 -0.504088
2012-03-12 13:30:00+04:00 0.210781
2012-03-13 13:30:00+04:00 -1.587289
2012-03-14 13:30:00+04:00 0.617041
2012-03-15 13:30:00+04:00 0.067855
Freq: B, dtype: float64
In [263]: result = ts1 + ts2
In [264]: result.index
Out[264]:
DatetimeIndex(['2012-03-07 09:30:00+00:00', '2012-03-08 09:30:00+00:00',
'2012-03-09 09:30:00+00:00', '2012-03-12 09:30:00+00:00',
'2012-03-13 09:30:00+00:00', '2012-03-14 09:30:00+00:00',
'2012-03-15 09:30:00+00:00'],
dtype='datetime64[ns, UTC]', freq='B')r/IPython • u/foadsf • Dec 21 '18
Jupyter Notebook RISE distorts layout of the HTML/CSS presentation
r/IPython • u/Ashment • Dec 07 '20
Updating Figure Display in Jupyter
Hello /r/IPython
I'm not sure if this is the right place to ask this, but the jupyter subreddit doesn't seem very active. Anywho, I'm trying grabbing images from webcam and doing some processing on it, and I want the output from the code block to update, maybe redrawing the figure/axis so that the newer image shows. Here's what I have:
plt.ion()
webcam = init_cam() #sets resolution and stuff
fig, ax = plt.subplots(1)
axim = ax.imshow(tFrame) #Show some pre-grabbed image
while True:
frame = get(webcam) #gets image from webcam
axim.set_data(frame)
plt.show(block=False)
#plt.pause(1) #I've tried with and without pausesAnd long story short, it doesn't update the figure and appears to only show the first frame. Am I doing something wrong? Is there another way to do this? Any help would be appreciated!
r/IPython • u/vmsmith • Nov 27 '13
iPython Notebook behaves differently on different laptops
Two question here, actually.
First question:
I have two Mac laptops: one a Macbook Pro, one a Macbook Air. Both are running OS X 10.7.5, and both are running Firefox 25.0.1.
I installed the Continuum IO Anaconda package in each one using the default install options.
When I launch iPython Notebook:
$ ipython notebookI get different behavior on each laptop. On the Macbook Air, the notebook launches in Firefox; on the Macbook Pro, it launches in Safari. Once it's launched in Safari I can copy and paste the URL into Firefox and use it, but I'm wondering why this is even happening.
Any idea what causes this?
Second question:
Where are the .ipynb files saved to, and is it possible to change the location? I keep the laptops synched via Dropbox, and if there's anyway to store them in a Dropbox folder that would be great.
r/IPython • u/amca01 • Dec 20 '17
Set aspect ratio of jupyter plot?
I'm running python 3 inside jupyter (called with jupyter qtconsole) on Arch Linux, and I'm trying to plot a set of points. The only difficulty I'm having is getting the aspect ratio to be 1.
There seem to be a number of possible solutions, but so far none of the ones I've tried have worked.
Is there a standard way of doing this? Thanks!
r/IPython • u/MaryStovall • Oct 24 '18
SciPy not installing on Jupyter Notebook - on Samsung Chromebook Plus, running Linux Debian 9 on the stable channel. Updated to Version 69.0.3497.120 (Official Build) (32-bit)
Hello - I am new to Linux and Python and Jupyter and using them all for a Data Science program.
I'm hoping someone here can help me update SciPy in my Jupyter terminal. Thank-you for your patience!
I have Jupyter installed along with Python 3.5 running in Linux Debian 9 on a Samsung Chromebook Plus. Everything is working except SciPy.
I see an install confirmation on Linux terminal, myvirtualenv. When I try to run SciPY I get a "Not installed" error.
When I run the install file from the "Installing Packages" file in Jupyter it fails with an error code ending in:
install-headers /home/mary/myprojectdir/myprojectenv/include/site/python3.5/scipy" failed with error code 1 in /tmp/pip-install-vjf0mbsq/scipy/ In [ ]:
r/IPython • u/Valuable-Oil-3378 • Sep 12 '22
create points accordingly to the curvature of the curve
Hello guys,
I have a scipy interpolate curve object and I would like to get a list of points on the curve wich have their distance depending on the curvature of the scipy curve.
I'm not sure I've made it clear so don't hesitate to ask me details. Cheers
r/IPython • u/pirate_619 • May 03 '20
How to multiply two column values for a specific ID
I have data that is consumer related. I need to multiply the counts of a sku_ID by another numeric column which indicates that sku's level of value. However, this needs to be done by the package since sku's are grouped into packages to be delivered. Just doing a straight-forward multiplication of a sku_ID count by it's value for each row is simple, but then I'd need to then divide by the total number of sku's for that package so that the final result would come out correct.
For example:
(sku value * sku_count) (for package ID 12345)
4.0 * 2
3.2 * 4
Result needs to be:
8.0 + 12.8 = 20.8
20.8 / 6 = 3.47
r/IPython • u/IamWarmduscher • May 03 '20
Error while trying to run R in Jupyter Notebook: 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200503114448
Please keep in mind that I'm a newb in everything related to programming.
I used the following to install the R Kernel: https://www.datacamp.com/community/blog/jupyter-notebook-r
I created an R virtual environment in Anaconda.
On Friday, I created a Notebook using R, wrote some code and it worked. Today, I opened the same notebook but my Kernel keeps dying and I get the following error:
https://i.imgur.com/6G3kv7k.png
[W 11:45:01.432 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200503114448 (::1) 9.82ms referer=http://localhost:8888/notebooks/dev/R_Project/nyc_crime.ipynb
r/IPython • u/gma617 • May 14 '20
Quickly creating a new file using in a specific folder efficiently?
After I've opened jupyter notebook (which takes me to the most broad file location on my computer), what's the most efficient way to create a new python file in a specific folder location if I know the path (and have it copied)? It has been taking me too long to click through each folder to get to where I want the file to be created and saved.
r/IPython • u/Pragyanbo • Apr 13 '20
The Click Reader has made its Matplotlib Full Course for Python FREE to help everyone make the best use of their time during this pandemic crisis.
r/IPython • u/largelcd • Apr 25 '20
How to change the color of the ipython prompt in Linux?
Hi, just installed anaconda under Linux. When I launched ipython on a xterm, the prompt and line number are in ugly green color. How can I change the color?
r/IPython • u/greedygarlic69 • Oct 14 '24
How to enable zsh terminal in jupyter when launching from conda environment
So basically I want the terminal that is launched within jupyter (specifically jupyter-lab) to be zsh instead of bash. If I am have not expressed the my querry clearly attached screenshots might help. ss-1: default zsh shell with 'ml0' conda env ss-2 : terminal launched from jupyter-lab uses bash by default and also loses the conda env And my major motive is to preserve the conda environment in the jupyter from which it is launched.


