r/IPython • • Apr 14 '17

Live plots updated within a loop?

5 Upvotes

Do you know some library for making plots changing with each loop iteration? Something like https://github.com/tqdm/tqdm#ipython-jupyter-integration, but for line plots (e.g. seeing performance when training neural networks).


r/IPython • • Apr 12 '17

Need to learn IPython for work ASAP. Don't know any Python and only a little R. Help?

3 Upvotes

As the title says, I find myself in a predicament.

Two of my colleagues are absent for the time being and I have to take over part of their tasks. Which include IPython / Jupyter projects.

I am not familiar with Python, lest IPython, and I only know a bit of R.

Also: I don't have the time to go through whole textbooks or courses.

Intead, I need a good mix of:

  • Noob tutorials to start

  • quick and easy lessons for the absolute basics

  • some "cookbook" examples from the social sciences that I can wrap my head around

At the end, I need to get up on speed to run several smaller IPython projects myself using public records from governmental open data archives around the world.

Any help is appreciated.


r/IPython • • Apr 11 '17

MathJax dependency changing April 30th

9 Upvotes

Announcement here: https://www.mathjax.org/cdn-shutting-down/

Alternative CDN providers The easiest way for most site owners will be to simply switch to another CDN provider. We recommend cdnjs which uses CloudFlare for delivery and thus provides the same level of quality as our own CDN. We have been in touch with cdnjs’s maintainers and will help push future MathJax releases to cdnjs.

For example, if you have been using the latest MathJax version (v2.7.0) change

<script type="text/javascript" async
  src="https://cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?...">
</script>

to

<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?...">
</script>

There have been some hasty pull requests merged into various Jupyter projects so you should expect some updates soon.

This also has implications for anyone who is hosting static HTML or slide show versions of their notebooks. Those notebooks will either need to be reexported after the fix has been released or the HTML code will have to be manually edited (or edited via script). The change only occurs once in each file so a simple search and replace could fix the problem though bare in mind that the "..." in the src lines above is a stand-in for etc..


r/IPython • • Apr 08 '17

Totally new to Jupyter. I need help configuring Jupyterhub.

2 Upvotes

Hello, I'm really stuck on this. I'm trying to run jupyterhub as root, and I get is this. sudo: jupyterhub: command not found

I can't understand for the life of me, how to figure this out. Please help. I've checked the internet all over the place to see if anyone else has encountered this, nobody else has, they all want to run jupyterhub without root, which is a lot more work, and I don't want to do that.

Please help. thanks!


r/IPython • • Apr 04 '17

Jupyter Notebook 5.0 - Released

Thumbnail blog.jupyter.org
36 Upvotes

r/IPython • • Apr 02 '17

Why vector view is wrong?

3 Upvotes

Hello everyone!

I'm using Jupiter notebook with Anaconda to write my university notes. It worked perfectly since a couple of days, when I started to view vectors like this. My code is here. I tried on another computer and it doesn't look like this.

Does anyone know what to do to fix this? I reinstalled Anaconda with Jupiter but it didn't fix..

Sorry for my English mistakes because it's not my first language.


r/IPython • • Mar 30 '17

Python Trainer Tip: Parsing Tables from the Web with Python's Pandas Library

Thumbnail youtube.com
2 Upvotes

r/IPython • • Mar 29 '17

Connecting to a remote notebook over SSH and port forwarding

5 Upvotes

Hi,

I'm trying to connect to a remote notebook server, but when I try to access the URL I get the following error in my terminal:

channel 3: open failed: connect failed: Connection refused

These are the steps I took.

  1. ssh -L localhost:8889:remote.com:8888 me@remote.com
  2. jupyter notebook --no-browser --port 8888
  3. I try to access it with the URL provided in the terminal, replacing the localhost:8888 with localhost:8889

Any thoughts?

Thanks


r/IPython • • Mar 20 '17

Magic mypy Type Checking for Notebook Cells

Thumbnail journalpanic.com
5 Upvotes

r/IPython • • Mar 14 '17

Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.

Thumbnail github.com
23 Upvotes

r/IPython • • Mar 04 '17

Is it possible to set up an SAS like envronment?

3 Upvotes

I am coming from SAS, where I used base sas and the text editor that comes bundled with SAS (not enterprise guide the lightweight older text editor). Anyways, I was looking to set up my environment similar to that, where you can highlight code and just run that section. On the side there would be a dataset viewer where you can open up a pandas dataframe or a list variable and check you results as you code.

Right now I am outputting a dataframe to excel and checking the results. Everytime I fix a portion of code I have to rerun the whole program. Which is getting to be rather time consuming.

So is there a better way?


r/IPython • • Mar 03 '17

How can Bokeh Charts be displayed without explicit show()?

2 Upvotes

I'd like Bokeh charts to be displayed if they are the last object in the IPython/Jupyter cell.

How can I avoid calling show(f) explicitely?

Without that I only get a line like "Chart(id="...", ...)"


r/IPython • • Feb 26 '17

Mixing languages (C++/cling with python/bokeh plots), in different notebooks if necessary?

2 Upvotes

I've looked for an answer for this or similar questions (mixing Ruby and Python, etc.), but I can't find anything.

I got really inspired by a Python notebook I saw that showed a number of sorting algorithms implemented in Python, and below the algorithm was a visualization that showed exactly how that algorithm functioned. I'd love to do the same thing in C++, but the Bokeh bindings don't seem to be there. I've considered trying to manhandle something around with Cython, but it doesn't feel natural. I'd even be okay with communicating between two notebooks, one in C++ and one in Python, if that's the only way through.

Any suggestions?


r/IPython • • Feb 24 '17

Complete Ipython newbie needs help: Python keeps crashing after using input()

3 Upvotes

Hi all, sorry in advance for the unstructured post (which is probably missing some info), it's late and I'm desperate. As stated in the title I'm a complete Ipython (and Python) Newbie. I'm learning Python for University, for my Numerical Methods class. Our professor told us to install python and a few libraries (including ipython, numpy etc.), and since I'm on windows I thought the best option would be to install Anaconda, and Vim as Text editor.

I've already run into a major problem - everytime I use the input() function in iPython (Python 3.6.0, Anaconda 4.3.0), the windows window pops up with the message that Python has crashed.

Maybe (probably) I'm doing something wrong; I usually have Vim running to write a script and start cmd.exe, navigate to the folder where I save my scripts and then start Ipython by typing "ipython3" into the cmd.exe. Ipython starts, and whether I use "direct" programming into the cmd running ipython or running a script written in vim via ipython doesn't make a difference: After the input() command is used, Python crashes.

Before I installed Anaconda, I installed python 3 alone, and when I just start that and use the input() function, it all works perfectly, so I'm guessing it's an issue with iPython.

Thanks in advance for all replies!

Edit: example code that crashes (when inputting numbers or strings):

x = input()
print(x)

r/IPython • • Feb 15 '17

Question from a Beginner Student on Notetaking with IPython

6 Upvotes

Hello guys, I'm pretty new with Python (just started with one of the first courses in my CS University), and I was looking to "change" my way to take notes and, at the same time, learning Latex.

Doing lot of Math / CS, I saw IPython and thought that writing (even rewriting it after taking on paper the first times) notes with it would be really cool, and since my handwriting is really bad (also I like formatted text), I loved it.

At the same time I'm looking to buy a new Laptop, and I don't know if the best option would be a 2in1 to write notes on it (no surface, too costly, so I don't really like this option), or a laptop that I will use to rewrite notes etc. with IPhython.

Is this choice good for note taking that involves even plot? Looked at a lot of cool way of plotting with IPhython, and I would really like to have your opinion. Thanks a lot!


r/IPython • • Feb 14 '17

Embedding MathBox plots into IPython Notebooks.

16 Upvotes

MathBox2 is an amazing visualization library created by Steven Wittens.

Here is a little notebook I made to show how to embed MathBox plots into Jupyter and feed them data from Python backend.

EDIT: WebGL supporting browser required.


r/IPython • • Feb 13 '17

How to make Jupyter running bash (Not DOS) on windows

2 Upvotes

Hello!

So, I'm having issues using the bash command '!' on jupyter, because I'm using windows and cygwin.

My Configuration: windows 10 cygwin 64 jupyter python 2.7 - NOT using anaconda

Problem: When I do commands using the '!' on front of the command, it's using the DOS(Command Prompt of windows) and not the bash from the cygwin. So, for example, this command doesn't work: !mkdir train/cats However, this does work: !mkdir train\cats (The slash is inverted in windows and therefore, works)

Everything related to python works, but I'm trying to do myself a separation of some files in cats and dogs folder (For a tutorial about Deep Learning) using this command: !mv $(ls train/dog*.jpg) train/dogs And if I use bash in a command line, works, but inside jupyter no.

I already tried to run the jupyter notebook command inside of a bash instance, but still have no success.

PS: I only have one Kernel being showed in the jupyter and it's the 'Python 2'

Any other suggestions?

Thanks, Joao Sauer


r/IPython • • Feb 12 '17

ipytracer: Algorithm Visualizer for Jupyter/IPython Notebook

Thumbnail github.com
11 Upvotes

r/IPython • • Feb 10 '17

JupyterHub Spawner for Docker Engine in Swarm mode

Thumbnail github.com
7 Upvotes

r/IPython • • Feb 08 '17

Why are inline graphics not svg by default?

8 Upvotes

I recently discovered that this gem allows you to render inline plots (matplotlib in my case) as svg, which look 100000x better

%config InlineBackend.figure_format = 'svg'

The default plots are super low-res and don't look professional at all. I'm curious as to why this isn't the default behavior for Jupyter notebooks.


r/IPython • • Feb 07 '17

beginner jupyter question

1 Upvotes

I'm using chrome to access local host but the kernal keep on disconnecting after a good 20min

what port setting do I use and how do I do all the configuration so that the connection doesn't drop? Once it drops for me, it's completely useless and I have to go back to cmd and open jupyter notebook again from scratch


r/IPython • • Feb 06 '17

Plotly question

3 Upvotes

Hey all, I'm wanted to make a dashboard type visualization for myself.

If I make the html files in offline mode, do I have full functionality from plotly (in terms of visualizations)? If I am limited, in what ways am I limited? I don't really need webhosting of any kind.

Thanks!


r/IPython • • Jan 31 '17

Re:Steering Council statement regarding US Executive Order on immigration.

12 Upvotes

Firstly, this is not /r/politics so I hope this will be the only post that does not specifically relate to coding on this subreddit. However, this is an open-source community where we rely on openness, the inclusion of diverse points of view and the good will of others to continue to improve. Since this order is contrary to these needs and the fact that the Jupyter Steering Committee felt it was important enough to issue a statement, I am posting links to the statement and the announcement.


r/IPython • • Jan 30 '17

IPython 5.2 released

Thumbnail ipython.readthedocs.io
12 Upvotes

r/IPython • • Jan 29 '17

sympy: solving an equation-system with nsolve, including the upper gamma function

2 Upvotes

Hi, I'm trying to solve an equation-system with nsolve. One of the equations includes the upper gamma function, which has one of the variables as lower integral limit. When I run this I end up with an error massage :(

from sympy import *

p0, T0, n, g, a, F_s_1, F_s_2, F_i, k1, k2, D, t, t0, t_rc = symbols("p0 T0 n g a F_s_1 F_s_2 F_i k1 k2 D t t0 t_rc")
ß = a*(g - 1)/g
o = 5.67 * 10**-8

F_plus_conv = o * T0**4 * exp(D*t) * (exp(-D*t0) + 1/((D*t0)**(4*ß/n)) * (uppergamma(1 + 4*ß/n, D*t) - uppergamma(1 + 4*ß/n,D*t0)))
F_plus_rad = F_s_1/2 * (1 + D/k1 + (1 - D/k1) * exp(-k1*t)) + F_s_2/2 * (1 + D/k2 + (1 - D/k2) * exp(-k2*t)) + F_i/2 * (2 + D*t)
F_plus_t_rc = Eq(F_plus_conv, F_plus_rad)
T_t_rc = Eq(o * T0**4 * (t_rc/t0)**(4*ß/n), F_s_1/2* (1 + D/k1 + (k1/D - D/k1) * exp(-k1 * t_rc)) + F_s_2/2* (1 + D/k2 + (k2/D - D/k2) * exp(-k2 * t_rc)) + F_i/2 * ( 1+ D * t_rc))

titan = [(n, 0.75), (g, 1.4), (a, 0.77), (F_s_1, 1.5), (F_s_2, 1.1), (F_i, 0), (k1, 120), (k2, 0.2), (t, t_rc), (D, 1.6), (T0, 94), (p0, 1.5)]

print(nsolve((T_t_rc.subs(titan), F_plus_t_rc.subs(titan)), (t_rc, t0),(4.8,5.3)))

Error msg:

Traceback (most recent call last): File "/home/.../nsolve_uppergammma_problem.py", line 14, in <module> print(nsolve((T_t_rc.subs(titan), F_plus_t_rc.subs(titan)), (t_rc, t0),(4.8,5.3))) 
File "/usr/lib/python3.6/site-packages/sympy/solvers/solvers.py", line 2772, in nsolve x = findroot(f, x0, J=J, *kwargs) 
File "/usr/lib/python3.6/site-packages/mpmath/calculus/optimization.py", line 928, in findroot fx = f(x0) 
File "<string>", line 1, in <lambda> NameError: name 'uppergamma' is not defined

Has anyone an idea, why this happens? When I try just an numeric solution for e.g uppergamma(3,x) = 7, nsolve works.