FAQ Database Discussion Community


Unable to run ipython-notebook 2.7 with jupyterhub

ipython,ipython-notebook,jupyter
I am trying to run ipython 2.7 notebooks with jupyterhub on Ubuntu 14.04 - but I haven't been able to figure out a way. Any suggestions? I know one needs to add kernels in the file ~/.ipython/kernels.json I have the following in this file: { "argv": ["python3", "-m", "IPython.kernel", "-f",...

How to covert .ipynb to slides using nbconvert?

terminal,ipython,ipython-notebook,google-api-python-client
I created ipython notebook and I am be able to convert it to HTML and PDF. But when I tried to convert to it slides it turned out just like HTML on one file. Here is the code I use from a terminal prompt: $ ipython nbconvert --slides Testing.ipynb --post...

ipython - disable welcome message

ipython
Everytime i enter into ipython mode, ipython welcomes me with this message, WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv. Python 2.7.6 (default, Mar 22 2014, 22:59:56) Type "copyright", "credits" or "license" for more information. IPython 1.2.1 -- An enhanced Interactive...

IPython notebook: How to write cell magic which can access notebook variables?

python,ipython,ipython-notebook
My question is: How can I write an IPython cell magic which has access to the namespace of the IPython notebook? IPython allows writing user-defined cell magics. My plan is creating a plotting function which can plot one or multiple arbitrary Python expressions (expressions based on Pandas Series objects), whereby...

ipython use “%run” to execute a subset of a file

python,ipython,magic-function
Is there some way I can use %run to execute a subset of a file? Something like this: $ ipython In [1]: %run my_code.py -L 20 100 # executes lines 20-100 in ipython interpereter ...

replace loop variable in system shell command of ipython

python,for-loop,ipython,magic-function
I would like to iterate through a list (of sample names) and repeat the same command for each sample using the system shell command of ipython ("!"). I have done this previously with no problem but keep getting a SyntaxError under this specific code. If you know what is wrong...

invalid syntax when run cProfile

python,ipython,profile,cprofile
I tries to run python -m cProfile simple_test_script.py. I'm on Windows 7, Python 2.7.10. simple_test_script.py: import numpy as np from numpy.linalg import eigvals def run_experiment(niter=100): K = 100 results = [] for _ in xrange(niter): mat = np.random.randn(K, K) max_eigenvalue = np.abs(eigvals(mat)).max() results.append(max_eigenvalue) return results some_results = run_experiment() print 'Largest...

Custom Keybindings for Ipython terminal

python,keyboard-shortcuts,ipython,key-bindings
Is it possible to define custom keybindings and/or desactivate the default ones for Ipython terminal interface? For example, I have bound C+j and C+l to move left and right in my terminal by configuring the ~/.inputrc file (Linux), but when using Ipython terminal, C+l is captured before and actually clears...

IPython forward slash documentation

python,ipython
I accidentally discovered this feature in IPython: In [126]: def blah(): return 5 In [127]: /blah Out[127]: 5 In [128]: /range 5 2 4 Out[128]: range(5, 2, 4) In [133]: /int '100' base=16 Out[133]: 256 A line starting with a forward slash will have commas and function call parens automatically...

Bi-variant interactive function plotting using IPython

python,ipython,ipython-notebook
I want to plot two functions, say sine and cosine, with different frequencies --- so the first variable is the function to plot and the second is it frequency. I want to have a selector widget that selects the function and a slider that chooses the frequency. Is it possible...

error in solving acoupled,first order differential equations in ipython

scipy,ipython
I have a following coupled, first order differential equations: dB(t)/dt=-a*A(t); dA(t)/dt=b*B(t); dJ(t)/dt=cA(t)-dB(t) Solve the system using paramenters a = 0.05, b = 0.02, c = 0.03 and d = 0.04 of your own choice over a time interval from 0 to 200. Here is my code: a=0.05 b=0.02 c=0.03 d=0.04...

itorch creates a python console, not a torch console

ipython,torch
When I call itorch I don't get a torch console but an ipython console: ~$ itorch Python 2.7.3 (default, Dec 18 2014, 19:10:20) Type "copyright", "credits" or "license" for more information. IPython 0.12.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference....

write text file from text files python

python,python-2.7,python-3.x,subprocess,ipython
I have 3 output files containing x, y, z coordinates respectively file1.txt (contains x only) | file2 (Y) | file3 (Z) 2.113 3.023 -7.234 ... and a parent pdb file which contains coordinates data. I want to extract only those lines from pdb file matching with x,y,z coordinates from file1,file2,file3.The...

Find a null value and drop from a dataframe in Pandas

python,numpy,pandas,ipython
Hi I have a dataframe like this with 500+ rows. company_url company tag_line product data 0 https://angel.co/billguard BillGuard The fastest smartest way to track your spendin... BillGuard is a personal finance security app t... New York City · Financial Services · Security ... 1 https://angel.co/tradesparq Tradesparq The world's largest social...

AutoComplete in ipython with pandas Seems to be broken

python,pandas,autocomplete,ipython
I have a pandas dataframe named frame I want to invoke the frame[SomeCoulmnname].value_counts() method The issue is that ipython doesnt autocomplete even after i type v after the . In fact it doesnt even return any suggestions. But if i simply type Series. and press the tab it return me...

why does converting a python 'shelve' to 'dict' use so much memory?

python,memory,ipython,shelve
I have a very large python shelve object (6GB on disk). I want to be able to move it to another machine, and since shelves are not portable, I wanted to cPickle it. To do that, I first have to convert it to a dict. For some reason, when I...

Change default iPython in homebrew to use Python 2.x.x instead of Python 3.x.x

python,python-3.x,ipython,homebrew,jupyter
I used homebrew to install python 2.x.x and python 3.x.x I installed several package for both Python versions using the pip2 and pip3 commands. One of the packages I installed was iPython. Now, my default python command (i.e when I write pythonin the command line= points to Homebrew 2.x.x python,...

Remember breakpoints when debugging using ipython

python,debugging,ipython
I use ipython and run -d foo.py to debug my program. But every time I re-debug the program, I have to reset all the breakpoints. This is annoying when you have multiple breakpoints or multiple py files. Is it possible to let ipython or pdb to remember the breakpoints and...

How to run qtconsole connected to ipython3 instance?

ipython,python-3.4,qtconsole
When I run %qtconsole from within ipython3 I get ERROR: Line magic function%qtconsolenot found., but ipython3 qtconsole in terminal starts fine. According to this, how can I run qtconsole instance connected to ipython3 instance? And how to run it on a single core -- rc[0].execute(%qtconsole)? P.S. If someone know, tell...

Adding multiple rows in an existing dataframe

python,pandas,ipython
Hi I'm learning data science and am trying to make a big data company list from a list with companies in various industries. I have a list of row numbers for big data companies, named comp_rows. Now, I'm trying to make a new dataframe with the filtered companies based on...

Why sorted list detection does not work in this situation?

python,list,sorting,ipython
My goal is to have python code allowing to detect if a list is sorted or not. I would like to understand why the following code return True instead of my expected guess False l = [1, 2, 3, 4, 1, 6, 7, 8, 7] all(l[i] <= l[i+1] for i...

How do I change the kernel/python version for iPython?

python,osx,ipython
I have installed iPython using pip in OS X 10.10, and it gave me the "ipython" and "ipython2" commands, which run great, but which use OS X's default python version 2.7.9. I downloaded and installed the latest release of Python3.4 and can load it with the command "python3," but cannot...

How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?

python,ipython,ipython-notebook,ipython-parallel,jupyter
Dropdown menu in the top-right of the UI on a local machine (PC): Kernel-> Change kernel-> Python 2 (on a local PC) Python 3 (on a local PC) My new kernel (on a remote PC) ...

In IPython, help(raw_input) returns ' raw_input lambda prompt='' '. What is the meaning?

python,ipython
When I try to use help() to get some function information on raw_input(), what I see is something rather difficult to understand: Help on function <lambda> in module IPython.kernel.zmq.ipkernel: raw_input lambda prompt='' Can anyone help to decipher this? Thank you....

How to access a variable in IPython from a program executed by %run

python,ipython
I have a program like this: if __name__=="__main__": foo = expensiveDataProcessClass(filepath) y = foo.doStuff() y = foo.doOtherStuff() I'm testing things out as a I build it in ipython with the %run myprogram command. After it's running, since it takes forever, I'll break it with ctrl+C and go rewrite some stuff...

starting IPython using Python code

python,shell,ipython
I'm in a Python 2.7 shell on Windows and, because I'm going crazy without tab completion and ? documentation, I want to start an IPython shell from there. For various (really tedious) reasons I can't launch IPython directly via Scripts\ipython.exe. I just want pure-Python code that will take me to...

Close an open h5py data file

python,ipython,hdf5,h5py
In our lab we store our data in hdf5 files trough the python package h5py. At the beginning of an experiment we create an hdf5 file and store array after array of array of data in the file (among other things). When an experiment fails or is interrupted the file...

How to update python 2.7 in HDP 2.2 using with Spark and Python

python,python-2.7,hadoop,ipython
I am trying to use Ipython and Spark in HDP 2.2 but it seems ipython is only supported from python 2.7. I have installed Spark and tested well, but the after installing ipython using yum command the version of python is a problem. [[email protected] spark12]# ipython Python 2.6.6 (r266:84292, Jan...

Ipython : Installation error, unable to find _sqlite.so

python,sqlite,python-3.x,sqlite3,ipython
On trying to install ipython for Python3.4 I get a message that it is already installed. pip3 install ipython Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/local/lib/python3.4/site-packages But when I try to run it with ipython3 notebook I get all this: Traceback (most recent call last): File "/usr/local/bin/ipython3",...

debugger in ipython is not working

python,debugging,ipython
I trying to use the debugger in ipython 3.1 on my python 2.7.9 installation on Windows 7. Here is an example script: def works_fine(): a = 5 b = 6 assert(a + b == 11) def throws_an_exception(): a = 5 b = 6 assert(a + b == 10) def calling_things():...

IPython IPCluster different path for different nodes

python,ipython,ipython-parallel
I have two nodes that I'd like to run IPython.parallel engines on. One of them is a linux box, the other runs MacOSX. The directory names are slightly different on the different machines and I can't find a way to start SSHEngines on both machines at the same time. It...

How to call module written with argparse in iPython[notebook]

python,ipython,bioinformatics,biopython,suffix-tree
I am trying to pass BioPython sequences to Ilya Stepanov's implementation of Ukkonen's suffix tree algorithm in ipython's notebook environment. I am stumbling on the argparse component, I have never had to deal directly with argparse before. How can I use this without rewriting main()? By the by, this writeup...

Can you upload a data file in a ipython notebook

python,ipython,ipython-notebook
I'm using Ipython Notebook to do some data analysis and i'd like to be able to "upload" (really just copy) data files inside the Json Ipython notebook. This way the Ipython notebook is self contained and doesn't depend on a external file position As an example with open("Anyfile.dat", "r") as...

Redirect output of python/ipython interactive prompt commands to files or variables

python,command-line,ipython
If I execute a function at the Python or Ipython command prompt, such as 'help(dir)': >>> help(dir) Help on built-in function dir in module __builtin__: dir(...) dir([object]) -> list of strings If called without an argument, return the names in the current scope. I'd like to capture the resulting output...

Why is it possible to call functions using slashes in iPython?

python,ipython,ipython-notebook
Today I encountered the possibility to call functions using a rather odd slash-syntax in the iPython console. It worked for me using iPython 2 and 3 on both Windows and Linux as well as in the Notebook but not in a regular Python console. An example of what I mean:...

Playing with packages in IPython

python,ipython,python-import
I am working with a Python package that uses relative imports. So from one module, local imports look like: from . import module The package is structured like so: package/ __init__.py module1.py module2.py moduleN.py subpackage1/ __init__.py module1.py module2.py subpackage2/ __init__.py ... etc. I would like to import one of these...

Explain {isinstance} in iPython prun output?

python,pandas,ipython
I'm trying to profile a few lines of Pandas code, and when I run %prun i'm finding most of my time is taken by {isinstance}. This seems to happen a lot -- can anyone suggest what that means and, for bonus points, suggest a way to avoid it? This isn't...

Returning to host code in pyCUDA after asynchronous kernel launch

python,python-2.7,cuda,ipython,pycuda
I am trying to launch a kernel in pyCUDA and then terminate the kernel by writing to a GPU global memory location. Here is a simple example kernel that I would like to be able to terminate at some point after it enters the infinite while loop: __global__ void countUp(u16...

How do I inspect one specific object in IPython

python,ipython
I'm coming from MATLAB and am used to the whos command to get variable information such as shape and data type and often used this with a specific names (e.g., whos Var1). I know I can use whos in IPython as well; however, when I have a ton of variables...

jupyter kernels in OSX: No module named IPython

python,osx,ipython,anaconda,jupyter
Quick side note: This question is based on issue #7947 in ipython's bug tracker. The problem seems to be an issue related to either OSX, or some weird settings on my mac (maybe both). I cannot reproduce it on a fresh Ubuntu box. I am aware that the underlying problem...

Using iPython with nose?

python,ipython,nose,pdb
I have a fairly basic question. I'm running the nosetests command for my python application's test suite. I want to drop into an interactive debugger. As the tests are run, it hits my IPython.embed() line and freezes, no prompt. Ctrl+C kills it and resumes the tests. How can I drop...

Default notebook directory in iPython Notebook - iPython 3.0.0

ipython,ipython-notebook
I upgraded to iPython 3.0.0 (Python 3.4; using the Anaconda environment; Mac OSX 10.9.5) and the behavior on opening a new iPython Notebook session seems to have changed. I have set the c.NotebookManager.notebook_dir option in ipython_notebook_config.py to a particular directory; this used to cause the browser to open in that...

IPython notebook 3 - hide headers by default

customization,ipython,ipython-notebook
Before IPython notebook version 3.0 the notebook headers could be hidden by default by adding this to ".ipython\profile_default\static\custom\custom.js" (on windows): $([IPython.events]).on("app_initialized.NotebookApp", function () { $('div#header').hide(); $('div#maintoolbar').hide(); }); also see this question This does not seem to work anymore. It hides the headers, but it also leaves a big gap on...

How to prevent IPython notebook script pausing when the screen locks

ipython,ipython-notebook
I would like to run an IPython notebook script that will take several hours to complete (processing of ~40 movies). However the script pauses when the screen locks and then resumes execution when I login to my account.. Is there anyway to prevent the IPython script from pausing while the...

How to prevent IPython from activate to the cell below after running a cell?

ipython
After running a code in given cell, IPython goes down to the next cell below and activate it. How to set IPython so that it "stays" in the same cell after code is run?...

turtle width and pensize Difference?

python,python-2.7,python-3.x,ipython
i changed these attribute of turtle and they seem to do the same thing which is make the line drawn bigger or smaller, what's the difference between the two attributes? they seem to be the same thing

does IPython Notebook affect speed of the program?

python,numpy,ipython,ipython-notebook
I am developing a program for simulation (kind of like numerical solver). I am developing it in ipython notebook. I am wondering if the speed of the code running in the notebook is the same as the speed of the code running from terminal ? would browser memory or overhead...

Is there any way to force ipython to interpret utf-8 symbols?

string,utf-8,ipython,literals,diacritics
I'm using ipython notebook. What I want to do is search a literal string for any spanish accented letters (ñ,á,é,í,ó,ú,Ñ,Á,É,Í,Ó,Ú) and change them to their closest representation in the english alphabet. I decided to write down a simple function and give it a go: def remove_accent(n): listn = list(n) for...

How to Generate Graphs using Python Panda

python,graph,ipython
I am very beginner in python and i am learning ipython notebook. I am able to read excel file but i did not able to draw graphs from excel file.! Image : http://s15.postimg.org/wvo4zlsx7/Untitled.png Can you give me reference or code where i can learn python panda graphs. ...

Load local data into IPython notebook server

data,server,ipython
I did setup an ipython server for other people (in my compny department) to have a chance to learn and work with python. Now I wonder how people can load their own local data into the ipython notebook session on the remote server. Is there any way to do this?...

Troubles after updating ipython (%matplotlib nbagg)

python,matplotlib,ipython,ipython-notebook,jupyter
I installed anaconda distro, I usualy run ipython notebook --pylab inline. I updated ipython using pip install (windows 8.1) and I don't have to write --pylab inline to start anymore I started writing in the cell: %matplotlib nbagg or matplotlib.use['nbagg'], but when I plot something it shows this empty box:...

Open 'ipython notebook' as: IPython notebook vs Jupyter

ipython,ipython-notebook,jupyter
I expected to find more documentation on the following: From one computer: C:\Python>ipython notebook opens the browser as 'IPython notebook'. From second computer: C:\Python>ipython notebook opens the browser as 'Jupyter'. I dont have a preference, but when saving from 'Jupiter', I can no longer open the .ipnb in 'IPython notebook'....

Can't import ggplot module in iPython

ipython,python-ggplot
I'm trying to use ggplot in an Anaconda iPython notebook. I ran %matplotlib inline and from ggplot import *, but I just get the following error: ImportError Traceback (most recent call last) <ipython-input-3-02aeb6e281ab> in <module>() ----> 1 from ggplot import * ImportError: No module named ggplot Where in the Anaconda...

Can I make ipython exit from the calling code?

python,ipython
I have some code like this: form IPython import embed for item in my_item_list: embed() If I then run this program with python my_example_program.py on the first iteration through the loop I get put into an ipython shell and can inspect item and the environment as I would like to....

How to import modules in IPython Clusters

ipython,ipython-notebook,ipython-parallel
I am trying to import some of my personal modules into my IPython Clusters. I am using Anacondas on Windows Vista 64 bit from IPython.parallel import Client rc = Client() dview = rc[:] with dview.sync_imports(): import lib.rf It is giving me this error: No module named 'lib.rf' I can import...

Ipython storemagic to store all available variables

ipython,storemagic
I recently discovered storemagic in ipython, and I would like to use it to save my work across sessions. However, in some sessions I generate a large number of variables, and I would like to say at the end of the session %store all, or something like that, so that...

double click to open an ipython notebook

python,ipython,ipython-notebook
Related posts: Open an ipython notebook via double-click on osx How can I open Ipython notebook from double click? I always cd to the directory of the notebook, then type ipython notebook in the browser and then open it in the browser. This steps is very inconvenient. In windows, I...

install ipython for current python version 2.x

python,ipython
The python version is 2.7.6 but when I install IPython sudo pip install ipython ipython it points to python 3.4.0. This leads to many syntax errors in modules that I commonly use due to python 3.x incompatibility. I try editing the first line of the script /usr/local/bin/ipython: #!/usr/bin/python3.4 becomes #!/usr/bin/python...

How to manage and communicate with multiple IPython/Jupyter kernels from a Python script?

python,ipython,ipython-notebook,jupyter
I want to mimic the functionality of a notebook server, and instead coordinate the creation/management of different IPython/Jupyter kernels from a central body of logic (i.e. my own Python script). For example, I want to: Define an abstract command e.g. "add(x, y)" Communicate the abstract command to multiple kernels e.g....

Where is the history file for ipython

python,ipython
I can not determine where the ipython is storing its history. a. There is no ~/.pythonhistory: 12:49:00/dashboards $ll ~/.py* ls: /Users/steve/.py*: No such file or directory b. Nothing special in the python startup file: 12:49:07/dashboards $echo $PYTHONSTARTUP /shared/.pythonstartup 12:49:43/dashboards $cat /shared/.pythonstartup import rlcompleter import readline readline.parse_and_bind("tab: complete") c. BUT: i...

IPython notebook stops evaluating cells after plt.show()

python,pandas,matplotlib,ipython,ipython-notebook
I am using iPython to do some coding. When I open the notebook and run some codes by doing SHIFT+ENTER it runs. But after one or two times, it stops giving any output. Why is that. I have to shutdown the notebook again open it and then it runs for...

Detect if IPython Pylab GUI event loop is active

python,matplotlib,multiprocessing,ipython
Is there a canonical way of detecting inside the interpreter if IPython was called with options like--pylab=... or --gui=...? The reason: I want to do some asynchronous plotting in a separate process, as show in the sample script tst_process.py: #!/usr/bin/env python # -*- coding: utf-8 -*- """ File tst_process.py """...

No module named sympy

python,python-2.7,ipython,ipython-notebook,sympy
Hi I'm learning linear algebra with python with an Edx course. (http://nbviewer.ipython.org/github/ULAFF/notebooks/tree/may-14-2014/). On "02.4.2.10 Practice with matrix-vector multiplication" with the first box, the code is: import generate_problems as gp print("What is the result of the matrix vector product below?") p = gp.Problem() p.new_problem() generate_problems is a module that the professor...

TypeError: __repr__ returned non-string (type bytes)

python,python-3.x,oauth,ipython
I am trying to access the Discogs API using their Python client library. Here is a minimal example of my attempts to interact with the Discogs API: from SensitiveInformation.discogs_application_info import provide_discogs_auth, provide_verifier import discogs_client discogs_consumer_key, discogs_consumer_secret = provide_discogs_auth() discogs = discogs_client.Client(user_agent="ThoughfulMachineLearning", consumer_key=discogs_consumer_key, consumer_secret=discogs_consumer_secret) discogs_auth_url = discogs.get_authorize_url()...

IPython Notebook: %run magic on non-python file types

python,ipython
From in the notebook, it's easy to run an external python module with %run. For example, if I wanted to run foo.py: %run foo But how does one run a file not ending in .py? For example, if I had a bash script, bar. When I try: %run bar ERROR:...

IPython MPI with a Machinefile

ipython,mpi,distributed-computing
I want to use IPython's MPI abilities with distributed computing. Namely I would like MPI to be run with a machine file of sorts so I can add multiple machines. EDIT: I forgot to include my configuration. Configuration ~/.ipython/profile_default/ipcluster_config.py # The command line arguments to pass to mpiexec. c.MPILauncher.mpi_args =...

Initialize interpreter with variables

python,ipython,interpreter,python-interactive
How do I initialize the python interpreter such that it already has variables in its memory? For example, how could I initialize a[n i]Python interpreter, and type as my first input: In [1]: today Out[1]: '2015-05-05 17:49:32.726496' without first binding the name str(today = datetime.datetime.today())?...

TypeError: zip argument #1 must support iteration (Vector sum for Ipython)

python,vector,ipython,linear-algebra,ipython-notebook
Hi I'm following "Data Science from Scratch" and I got an error when I was making vector sum function. Could someone help? The code: a = [1,2,3] b = [2,3,4] def vector_add(v, w): """adds two vectors componentwise""" return [v_i + w_i for v_i, w_i in zip(v,w)] vector_add(a,b) #prints [3, 5,...

How to persist ipython notebook without persisting output?

django,git,ipython,ipython-notebook,hipaa
I have an ipython notebook that I invoke through Django's shell_plus --notebook command. I would like to save the notebook, meaning the code cells, without saving the output that follows each code cell. I use this notebook to do analytics and reporting on sensitive patient data covered by HIPAA and...

Printing 2 Python Pandas DataFrame in HTML Tables in iPython Notebook

python,pandas,ipython,ipython-notebook
Question: How can you print 2 DataFrame tables together from 1 iPython Notebook row, such that both tables are displayed in the pretty table format? The following prints just the second one, and print df.head() does not produce a pretty table. df = pd.DataFrame(np.random.randn(6,4), index=pd.date_range('20150101', periods=6), columns=list('ABCD')) df2 = pd.DataFrame(np.random.randn(6,4),...

Add months to a datetime column in pandas

python,python-2.7,python-3.x,pandas,ipython
I have a dataframe df with 2 columns as below - START_DATE MONTHS 0 2015-03-21 240 1 2015-03-21 240 2 2015-03-21 240 3 2015-03-21 240 4 2015-03-21 240 5 2015-01-01 120 6 2017-01-01 240 7 NaN NaN 8 NaN NaN 9 NaN NaN The datatypes of the 2 columns are...

Python class instance not being destroyed at end of method [duplicate]

python,class,garbage-collection,ipython,spyder
This question already has an answer here: How do I avoid having Python class data shared among instances? 6 answers I should begin by saying this is being run in IPython, using the Spyder IDE if it makes a difference. I am somewhat of a newbie at Python but...

IPython notebook does not capture all console output

python,ipython,ipython-notebook
within my code I use a Python package that calls external programs which write their output to the same console that IPython is running in. If I now run the same code from an IPython notebook, the output is not written to the notebook output cells, but into the console...

IPython notebook 2.3.0 on Fedora 21 cannot find FontAwesome

python,ipython,ipython-notebook
Looking for help trying to tell IPython notebook where to find the fontawesome fonts on Fedora 21. They are apparently packaged separately under /usr/share/font-awesome-web. Is there some configuration for this? Failure to find/serve the font is causing the buttons not to render correctly in the browser... In the browser, I'm...

IPython, Ploting a Polynomial

plot,ipython,sympy,polynomials
I've been working with Sympy for an Interpolation, in wich I obtain as a result a 7th degree Polynomial (ax^7 + bx^6 + cx^5 + ...+ h) wich I want to Plot, but wen I try to plot it I get errors, for example, if i try: plt.plot(r,U.subs(x,r)) where r...

Ipython notebook pyzmq error

ipython,ipython-notebook
When I run ipython notebook; I get "ImportError: IPython.html requires pyzmq >= 13" error message in console. I already run " pip install "ipython[notebook]" " but I can not run the notebook. Could you pls assist how to solve this issue. C:\Python27\Scripts>ipython notebook Traceback (most recent call last): File "C:\Python27\lib\runpy.py",...

Print into console terminal not into cell output of IPython Notebook

python,windows,ipython,ipython-notebook,python-3.4
I would like to print into the terminal window that runs IPython Notebook and not into the cell output. Printing into cell output consumes more memory and slows down my system when I issue a substantial number of print calls. In essence, I would like this behaviour by design. I...

IPython3 automatically config %matplotlib inline

python,matplotlib,ipython,ipython-notebook
I'm using IPython 3 / Jupyter, and I want to use the %matplotlib option by default. In IPython 2, I had the next option on the ~/.ipython/profile_default/ipython_notebook_config.py c.InteractiveShellApp.matplotlib = 'inline' But in IPython 3, this option is not available anymore. It also disappeared the setting c.InlineBackend.rc, which I used to...

How to run shell-commands in IPython? (Python Profiling GUI tools)

python,shell,profiling,ipython,ipython-magic
I am trying to do file profiling in IPython, generate some profiling stats output and then pass it to some Python profiling GUI tools like KCachegrind. Here is my code trying to do that. All codes are executed in IPython. # example function for profiling def factorial(n): if n ==...

How to use groupby in Pandas to compute columns

python,numpy,pandas,ipython
I have a table based on data that is not aggregated. I want to use GroupBy to "slice" my data and compute averages for each scenario. For example, let's look at some heroes in dota since it's a fun game: Bracket MatchID Duration Hero Radiant Win Kills Deaths Assists GPM...

Loading a .NET DLL in Interaction Python on Linux

python,.net,ipython
I have a Linux server running Interactive Python notebooks. I also have a .NET DLL containing functionality that I would like to use in my IPython notebooks. How can I load a .NET DLL in my IPython notebook? I have looked at Python for .NET, but it appears to be...

IPython Notebook: How to combine HTML output and matplotlib figures?

python,html,matplotlib,ipython,ipython-notebook
The following code outputs rendered HTML in the result cell of an IPython command: from IPython.core.display import HTML def putHTML(): source = """ <h1>Yah, rendered HTML</h1> <h2>Here is an image</h2> <img src="http://lbkbd.in/wp-content/uploads/2014/10/HTML-Logo.png"/> """ return HTML(source) How can I use this approach to include figures generated by matplotlib on the fly...

How to write an ipython alias which executes in python instead of shell?

python,macros,ipython,alias,ipython-magic
We can define an alias in ipython with the %alias magic function, like this: >>> d NameError: name 'd' is not defined >>> %alias d date >>> d Fri May 15 00:12:20 AEST 2015 This escapes to the shell command date when you type d into ipython. But I want...

How to standard-print `dir()` and other calls in Ipython

python,ipython
So generally Ipython prints result in single column lists: In [155]: dir() Out[155]: ['In', 'Out', '_', '_100', '_101', '_102', etc. How do I print this in the normal interactive-shell format? >>> dir() ['__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__'] ...

Is it possible to “mute” cells in ipython?

python,ipython
Image you have to run an ipython notebook over and over again but you want to exclude specific cells every now and then. At the moment I'm handling this by commenting out the cells I want to exclude. It works but it is quite tedious. Is there an easier way...

IPython notebook 3.0 automatically close brackets

ipython,ipython-notebook
I've just downloaded the new IPython 3.0 version. Some behaviour in the notebook has changed. Before, when I typed a open bracket it automatically closed it. This was particularly useful when selecting a text and putting brackets around it with just one click. I tried to adjust ~/.ipython/profile_default/static/custom/custom.js where I...

Can't inline Bokeh in IPython

python-2.7,ipython,bokeh
I have the latest Bokeh and IPython installed, and I try running the following: (all of these imports are relevant later on in the code) import pandas as pd import datetime import matplotlib.pyplot as plt import itertools as itt import bokeh.plotting as bk bk.output_notebook() xs = [0,1,2,3,4,5] ys = [x**2...

IPython loading variables to workspace: can you think of a better solution than this?

variables,numpy,save,load,ipython
I'm migrating from MATLAB to ipython and before taking the leap I'm going through my minimal workflow to make sure every operation I perform daily on MATLAB for data crunching is available on ipython. I'm currently stuck on the very basic task of saving and loading numpy arrays via a...

print values after each 1000 step

python,python-3.x,subprocess,ipython
I want to print value after every certain interval (1000) on last line of code than every single value. DARTS=200000 hits = 0 throws = 0 rangen = RanGenerator() pi = 0 avg = 0 mu = 0 var = 0 dev = 1 for i in range (1, DARTS):...

SublimeREPL and IPython

python,ipython,sublimetext3,sublimerepl
I fail when I tried to use IPython with SublimeREPL. My setup is: - Windows 8.1 - Sublime Text 3 - C:\Python34 - C:\Python27 - C:\Anaconda3\Scripts -> Here it's where Ipython is My PYTHONPATH and PATH are correct and I wrote in SublimeREPL settings - User: { "default_extend_env": {"PATH": "{PATH};C\\Anaconda3\\Scripts"}...

“Replot” a matplotlib inline plot in a IPython notebook

python,matplotlib,ipython,visualization,scientific-computing
if I work on a matplotlib inline plot in an ipython notebook like this: figure = plt.figure() ax = figure.gca(projection="3d") graph = np.empty([len(thetaYield),3]) for g, tY in zip(graph, thetaYield): sample = HWtoPS(xiYield, rhoYield, tY) g[...] = sample[:] ax.plot(graph[:,0],graph[:,1], graph[:,2]) plt.show() the plot is drawn inline in my notebook as it...

IPython change input cell syntax highlighting logic for entire session

python,ipython,syntax-highlighting,ipython-notebook
You can use extensions or display helpers in IPython to make whatever syntax highlighting you'd like on output cells. For some special cell magics, like %%javascript you can also see the input cell itself is rendered with that language's natural syntax highlighting. How can you cause every input cell to...

Read values from another cell in IPython Notebook and supply them for “input()”

python,ipython,ipython-notebook
As an example, if I have a cell that looks like: In [*]: for i in range(int(input())): print(i**2) When the cell is run, an input box pops up and waits for input to be provided. Is there a Built-in magic command or any way to programmatically supply values when input()...

Pass variable to Ipython Widget

python,input,widget,ipython
I have a simple widget that modifies a plot, here is the definition: #Plot function def plf(x,lm,ls): plt.plot(x[lm:ls],np.sin(x)[lm:ls]) this function takes a list x an plot sin(x), lm and ls controls the number of data that is ploted, the problem is when i try to plot a determinated list of...

image does not display in ipython

ipython
The image does not load if it is part of a while loop. For e.g. the following works as expected: from IPython.display import Image Image(filename='someimage.jpg') But this does not work: while True: Image(filename='someimage.jpg') break update: How do I display several images from a list?...

virtualenv IPython in Spyder not working

python,ipython,spyder
I have installed Spyder on Linux (Mint 17 to be exact) and created a scientific virtualenv (sci) with ipython, numpy, etc. The idea is to vary my virtual env for python 2 / python 3 and being a bit more flexible than installing the whole of Anaconda / python(x,y). I...

output_notebook() is not defined - why?

python,ipython,anaconda,bokeh
Trying Bokeh for the first time. Using the following example code from bokeh.pydata.org: from collections import OrderedDict from bokeh.charts import Scatter from bokeh.sampledata.iris import flowers output_notebook() Inside iPython (Anaconda, py 3.4, Win 7), get the following error: --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-2-c57c6fa8f51a> in <module>() ----> 1 output_notebook()...

Using both Python 2.x and Python 3.x in iPython Notebook

python,python-2.7,python-3.x,ipython,ipython-notebook
I use Ipython notebooks and would like to be able to select to create a 2.x or 3.x python notebook in Ipython. I initially had Anaconda. With Anaconda a global environment variable had to be changed to select what version of python you want and then Ipython could be started....

How do I configure mathjax for iPython notebooks?

python,ipython,ipython-notebook,mathjax
I'm trying to find a way for mathjax to not use STIX fonts for math in my iPython notebook. Instead, I'd much rather have it use the 'TeX' fonts. According to the documentation for Mathjax I should use: MathJax.Hub.Config({ "HTML-CSS": { preferredFont: "TeX" } }); That being said, I'm not...

How to inspect generators in the repl/ipython in Python3

python,python-3.x,ipython,python-3.4
I've been trying to switch to Python3. Surprisingly, my difficulty is not with modules or my own code breaking. My issue is that I am always trying and testing different aspects of my code in IPython as I write it, and having generators by default makes this infuriating. I'm hoping...