gary.church1 | 19 Oct 04:15 2014
Picon
Picon

tk: (9)


http://garridomarketing.com.br/6a7d8j9hg0w1t2u3o4b5x.php

Myranda Dettmer
Mark Andrews | 16 Oct 21:59 2014
Picon

start ipython notebook with a particular (not default) firefox profile

(Note: this is an exact copy of a unanswered question I asked on stackoverflow about 1 month ago).

When I launch ipython notebook, I want it to launch firefox but using a particular firefox profile, which is not my default firefox profile.

In my ipython profile, I have

c.NotebookApp.browser = u'/usr/bin/firefox'

and that makes sure that ipython notebook chooses firefox. However, it chooses the default firefox profile, or else the most recently used firefox profile.

From my linux terminal, I can launch my preferred ipython specific firefox profile (named ipython) like this

firefox -P --no-remote ipython

However, doing

c.NotebookApp.browser = u'/usr/bin/firefox -P --no-remote ipython'

does not work at all (ipython doesn't open firefox at all, and skips to the another browswer'), nor does starting ipython notebook like so

ipython notebook --browser 'firefox -P --no-remote ipython'

which leads to and OSError exception.

Does anyone know of a way to launch firefox with the preferred profile?

thanks

Mark Andrews

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Brian Blais | 11 Oct 01:18 2014
Picon

proper animation in notebook?

Hello,

I have just found out how to do animations within an ipython notebook,
by looking at:
http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/Animations%20Using%20clear_output.ipynb

However, when I do it myself I get the animation, but I get a memory
leak - the memory of the python process just keeps growing.  Here's my
code:

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

import sys
import time
from IPython.display import display, clear_output

x=linspace(0,6,100)
for t in linspace(0,20,100):
    clear_output(wait=True)
    f=figure(figsize=(10,10))
    plot(sin(x)*sin(t),'-o')
    gca().set_ylim([-1,1])
    display(f)
    close()

somehow I think it isn't actually deleting the figures from one call
to another, so it is building up in the background, although I am not
sure.  Is there a proper way to do this kind of animation in the
notebook without the memory continually increasing?

thanks!

Brian Blais

-----------------

             bblais <at> gmail.com
             http://web.bryant.edu/~bblais
Julien Schueller | 8 Oct 09:36 2014

lookfor magic extension module

Hi list,

I just uploaded to pypi the lookfor extension module to search through docstrings:
https://github.com/jschueller/lookfor

--

-- 
J
Ivan Ogassawara | 26 Sep 15:21 2014
Picon

Executing some function on IPython is slower than a normal python function

Dear all,

I'm testing some functionalities of ipython and I'm think I'm doing something wrong.

I'm testing 3 different ways to execute some math operation.

  • 1st using  <at> parallel.parallel(view=dview, block=True) and function map
  • 2nd using single core function (python normal function)
  • 3rd using clients load balance function
the code is here:

https://stackoverflow.com/questions/26039254/executing-some-function-on-ipython-is-slower-than-a-normal-python-function

My result is:

True True 0.040741 secs (multicore) 0.004004 secs (singlecore) 1.286592 secs (multicore_load_balance)

Why are my multicore routines slower than my single core routine? What is wrong with this approach? What can I do to fix it?

Some environment information: python3.4.1, ipython 2.2.0, numpy 1.9.0, ipcluster starting 8 Engines with LocalEngineSetLauncher


My best regards,

Ivan Ogassawara



_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
nirinA raseliarison | 25 Sep 01:35 2014
Picon

issues with Notebook and qtconsole after updating IPython

Hi there,
After updating IPython, currently running git commit '3849e0a', I  
encounter similar problem as described here:

http://mail.scipy.org/pipermail/ipython-user/2014-August/013799.html

but the proposed solution, opening different browser, solved only  
partially my problems.
     ipython notebook
seems to work with chromium, opera and firefox but
it doesn't start at all with seamonkey, i get the following error:

<seamonkey error>
ipython notebook
[I 01:23:59.599 NotebookApp] Using existing profile dir:  
'/home/nirina/.ipython/profile_default'
[I 01:23:59.618 NotebookApp] Using MathJax from CDN:  
https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 01:23:59.657 NotebookApp] Serving notebooks from local directory:  
/home/nirina
[I 01:23:59.657 NotebookApp] 0 active kernels
[I 01:23:59.657 NotebookApp] The IPython Notebook is running at:  
http://localhost:8888/
[I 01:23:59.657 NotebookApp] Use Control-C to stop this server and shut  
down all kernels (twice to skip confirmation).

(process:1297): GLib-CRITICAL **: g_slice_set_config: assertion  
`sys_page_size == 0' failed
[W 01:24:08.486 NotebookApp] Notebook /Untitled0.ipynb is not trusted
[I 01:24:08.850 NotebookApp] Kernel started:  
25d6d157-06a6-4a7c-b1c4-8032b29663ad
[E 01:25:34.884 tornado.application] Uncaught exception GET  
/static/components/codemirror/lib/codemirror.js?v=8dec958ead2e288182a77a5b3d87fe3c  
(127.0.0.1)
     HTTPServerRequest(protocol='http', host='localhost:8888',  
method='GET',  
uri='/static/components/codemirror/lib/codemirror.js?v=8dec958ead2e288182a77a5b3d87fe3c',  
version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language':  
'en-US,en;q=0.5', 'Referer':  
'http://localhost:8888/notebooks/Untitled0.ipynb', 'Host':  
'localhost:8888', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:29.0)  
Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1', 'Accept-Encoding': 'gzip,  
deflate', 'Connection': 'keep-alive', 'Accept': '*/*'})
     Traceback (most recent call last):
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/web.py",

line 1338, in _execute
         result = yield result
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 642, in run
         value = future.result()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/concurrent.py",

line 110, in result
         raise_exc_info(self._exc_info)
       File "<string>", line 3, in raise_exc_info
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 645, in run
         yielded = self.gen.throw(*sys.exc_info())
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/web.py",

line 2176, in get
         yield self.flush()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/gen.py",

line 642, in run
         value = future.result()
       File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/concurrent.py",

line 112, in result
         raise self._exception
     tornado.iostream.StreamClosedError
[E 01:25:34.916 tornado.general] Cannot send error response after headers  
written
</seamonkey error>

Another issue is with qtconsole,

     ipython qtconsole

seems to work, but:

     ipython qtconsole --profile julia

gives:

<qtconsole error>
/usr/local/lib/python3.4/site-packages/IPython/kernel/manager.py:96:  
UserWarning: Setting kernel_cmd is deprecated, use kernel_spec to start  
different kernels.
   warnings.warn("Setting kernel_cmd is deprecated, use kernel_spec to "
Starting kernel event loops.
ERROR:tornado.application:Exception in callback  
functools.partial(<function wrap.<locals>.null_wrapper at 0x7f7b24078d08>)
Traceback (most recent call last):
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/ioloop.py",

line 565, in _run_callback
     ret = callback()
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
170, in thread_send
     self.session.send(self.stream, msg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 646, in send
     msg = adapt(msg, self.adapt_version)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 152, in object_info_request
     line, _ = code_to_line(code, cursor_pos)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 24, in code_to_line
     return line, cursor_pos
UnboundLocalError: local variable 'line' referenced before assignment
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
433, in _handle_events
     self._handle_recv()
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
465, in _handle_recv
     self._run_callback(callback, msg)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
ERROR:tornado.application:Exception in callback None
Traceback (most recent call last):
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/ioloop.py",

line 837, in start
     handler_func(fd_obj, events)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
433, in _handle_events
     self._handle_recv()
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
465, in _handle_recv
     self._run_callback(callback, msg)
   File  
"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py", line  
407, in _run_callback
     callback(*args, **kwargs)
   File 

"/usr/local/lib/python3.4/site-packages/tornado-4.1.dev1-py3.4-linux-x86_64.egg/tornado/stack_context.py",

line 275, in null_wrapper
     return fn(*args, **kwargs)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/channels.py", line  
179, in _handle_recv
     msg = self.session.unserialize(smsg)
   File  
"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py",  
line 847, in unserialize
     return adapt(message)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 329, in adapt
     return adapter(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 68, in __call__
     return handler(msg)
   File "/usr/local/lib/python3.4/site-packages/IPython/kernel/adapter.py",  
line 262, in inspect_reply
     new_content['name'] = content['name']
KeyError: 'name'
</qtconsole error>

i will appreciate any hint,
thanks in advance.
--

-- 
nirinA
Andy Davidson | 21 Sep 21:54 2014

newbie iPython notebook, how to update matplotlib.pyplot figure/graph?

Hi 
 
I am new to iPthon notebook and matplotlib. I am trying to figure out how to create a loop that does the following

While( not done)
Read new data from network
Update data set
Redraw graph

Bellow is my test code. I figure out how to generated a new graph/fig every time I iterate how ever I can not figure out to pass the figure/plot into my graph function. Clear it and redraw

Any comments or suggestions would be greatly appreciated.

Thanks

Andy



%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import time

dynamicPosData     = [1, 1, 1, 1, 1] #[0, 0, 0, 0, 0] #[2, 12, 3, 7, 9]
dynamicNegData     = [1, 1, 1, 1, 1] #[0, 0, 0, 0, 0] #[1, 10, 2, 4, 8]
dynamicNeutralData = [1, 1, 1, 1, 1] #[0, 0, 0, 0, 0] #[3, 4, 5, 6, 7]
dynamicN = 5

def graph (fig, ax, posDataArg, negDataArg, neutralDataArg, NArg) :
    ind = np.arange(NArg)  # the x locations for the groups
    width = 0.25        # the width of the bars
    fig, ax = plt.subplots() # this will generated a new plot each time, not update existing plot
    ax.clear() # 
    rects1 = ax.bar(ind, negDataArg, width, color='r')
    rects2 = ax.bar(ind+width, neutralDataArg, width, color='y')
    rects3 = ax.bar(ind+width*2, posDataArg, width, color='g')
    ax.set_title('Are People Happy?')
    #ax.set_xticks(ind+width)
    ax.set_xlabel('1 to 5 sec ago')
    ax.legend( (rects1[0], rects2[0], rects3[0]), ('neg', 'unknown', 'pos') )
    fig.canvas.draw() # I thought this would cause the existing graph to update, how ever it does not work?
    
dynamicFig = plt.figure()
dynamicAx = dynamicFig.add_subplot(111)
i = 0
count = 3
while (i < count) :
    graph(dynamicFig, dynamicAx, dynamicPosData, dynamicNegData, dynamicNeutralData, dynamicN)
    plt.show()
    dataIndex = i % dynamicN
    dynamicPosData[dataIndex] = dynamicPosData[dataIndex] + i + 1
    dynamicNeutralData[dataIndex] = dynamicNeutralData[dataIndex] + i + 1
    dynamicNegData[dataIndex] = dynamicNegData[dataIndex] + i + 1
    i += 1
    time.sleep(5) # seconds
    
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Vladan Divljak | 14 Sep 05:41 2014
Picon

Feature request: Redirect history in side panel

Hi guys,

I was just thinking why %history action bloats my qt console terminal, instead printing the output  in side panel?

So, yeah.
Just think to call %history twice in a session and welcome to the jungle.


Cheers

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
desp | 12 Sep 04:05 2014

Notebook: How to search for function/method with non-prefix string

Say I'm in iPython notebook, and have done: import pandas [as pd]

Now I want to find a function that deals with CSV. Is there a way to do
something like:

*csv* /[auto-complete-like key]/

or 

*pd.csv* /[auto-complete-like key]/

and see all the function or method names that contain "csv" anywhere in
their name?

Thanks!

--
View this message in context: http://python.6.x6.nabble.com/Notebook-How-to-search-for-function-method-with-non-prefix-string-tp5071387.html
Sent from the IPython - User mailing list archive at Nabble.com.
Karl Traunm├╝ller | 10 Sep 21:57 2014

"IPython for iPad" app Computable updated to version 1.1

Dear all,

"IPython for iPad" app Computable has been updated to version 1.1.

New in version 1.1 are Python code completions, inline documentation, a Welcome Tour for new users, and some minor fixes and improvements.

The upcoming version 1.2 will bring faster Markdown and TeX/LaTeX math mode rendering by replacing the previous HTML/MathJax-based solution with a native LaTeX typesetting engine.

- Product page: http://computableapp.com
- Price: free to try, with $9.99 in-app purchase to unlock all features
- Author: Karl Traunmueller, indie Mac & iOS developer, Linz, Austria

regards,
Karl Traunmüller
<at> computableapp

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Richard Stanton | 7 Sep 09:08 2014
Picon

"Error connecting to server" with IPython notebook in one particular directory

I’ve been using IPython notebook with the Anaconda distribution on both OS X and Windows for quite some while. Mostly, everything runs without a hitch on both systems. If I type “ipython notebook”, my browser pops up with a list of ipynb files in the current directory, and off I go.

 

However, there’s one of my project directories where this doesn’t work. It’s fine on my Mac, but on the Windows machine, in this one directory (it works fine in other directories), the browser window shows no files (even though there are a number of notebook files there). Instead, it shows just the root (“/”), and on the line after this is the text “Error connecting to server”. In the command shell running the server, this is what I see:

 

2014-09-07 00:00:33.328 [NotebookApp] Serving notebooks from local directory: C:

\projects\ESOest

2014-09-07 00:00:33.328 [NotebookApp] 0 active kernels

2014-09-07 00:00:33.328 [NotebookApp] The IPython Notebook is running at: http:/

/localhost:8888/

2014-09-07 00:00:33.329 [NotebookApp] Use Control-C to stop this server and shut

down all kernels (twice to skip confirmation).

2014-09-07 00:00:33.875 [NotebookApp] ERROR | Unhandled error in API request

Traceback (most recent call last):

  File "C:\anaconda\lib\site-packages\IPython\html\base\handlers.py", line 332,

in wrapper

    result = method(self, *args, **kwargs)

  File "C:\anaconda\lib\site-packages\IPython\html\services\notebooks\handlers.p

y", line 78, in get

    for nb in nbm.list_notebooks(path):

  File "C:\anaconda\lib\site-packages\IPython\html\services\notebooks\filenbmana

ger.py", line 235, in list_notebooks

    for name in notebook_names if self.should_list(name)]

  File "C:\anaconda\lib\site-packages\IPython\html\services\notebooks\filenbmana

ger.py", line 262, in get_notebook

    created = tz.utcfromtimestamp(info.st_ctime)

  File "C:\anaconda\lib\site-packages\IPython\utils\tz.py", line 41, in utc_meth

od

 

    dt = unaware(*args, **kwargs)

ValueError: timestamp out of range for platform localtime()/gmtime() function

ERROR:tornado.access:{

  "Accept-Language": "en-US,en;q=0.8",

  "Accept-Encoding": "gzip,deflate,sdch",

  "Connection": "keep-alive",

  "Accept": "application/json, text/javascript, */*; q=0.01",

  "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML,

like Gecko) Chrome/36.0.1985.143 Safari/537.36",

  "Dnt": "1",

  "Host": "localhost:8888",

  "X-Requested-With": "XMLHttpRequest",

  "Referer": "http://localhost:8888/tree"

}

 

ERROR:tornado.access:500 GET /api/notebooks?_=1410073425115 (::1) 19.00ms refere

r=http://localhost:8888/tree

 

Any idea what’s going wrong? By the way, I’m currently using anaconda 2.0.1 with IPython 2.2.0 (the latest versions installed by anaconda), but I’ve seen this problem for a while, so I don’t think it’s just this version of IPython that’s the problem.

 

Again, “ipython notebook” runs fine in every other directory I’ve tried on the same machine.

 

Thanks for any suggestions.

 

Richard Stanton

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user

Gmane