2 Sep 21:30 2014

### can't make header cell in ipython notebook editor, editor in general seems different from online examples

Dear all,

I am new to iPython notebook, and recently created my first one. For some
reason, my notebook editor does not look like editor in the tutorials
online, and has less functionality. I would like to make heading cells in my
notebook, but I don't seem to have the option to make headings and the
keyboard shortcuts for headings don't work either. For instance, ctrl-m c
and ctrl-m m work as expected to toggle between code and markdown formats,
but ctrl-m 5 just types a 5.

I am attaching a screenshot of what my notebook editor looks like.
<http://python.6.x6.nabble.com/file/n5070023/ipythonscreenshot.png>

Here
<http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/table_of_contents_ipython.ipynb>
is an example of editor screenshots online that look different from my
editor.

Can you help me figure out how to make header cells/restore any other
missing functionality to my notebook editor?

Thanks!

--
View this message in context: http://python.6.x6.nabble.com/can-t-make-header-cell-in-ipython-notebook-editor-editor-in-general-seems-different-from-online-exams-tp5070023.html
Sent from the IPython - User mailing list archive at Nabble.com.

29 Aug 06:51 2014

### Cell scrolling quirks in Notebook

I use Notebook chiefly with Firefox on Mac, Windows, and Linux installations
and occasionally with Safari.

If I have a long output in a cell, activating the scroll feature has an odd
effect:

If I compress when the input line is off the screen, I wind up in a
different part of the Notebook, usually farther down, and the active cell
now on some different cell.  It's as if the cursor stays in one location and
everything moves up.  I usually lose lock on where I was and  wind up
activating cells out of sequence.

If the input line is on the screen, there is no problem.  The cell
compresses but the active cell remains highlighted.

I looked into custom.css per

http://www.damian.oquanta.info/posts/48-themes-for-your-ipython-notebook.html

and related links to see if there was a pertinent setting that addressed
this.  Couldn't find one there nor can I create a color scheme where I can
identify that this has happened definitively.

There's this issue that has been discussed but
a) I see this in Safari as well as FF
b) I'm unsure whether it is the same problem I'm having or if I'm getting terminology confused

https://github.com/ipython/ipython/issues/2041

JBB

[Please excuse any duplicates - I've been having some problems posting]
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user

28 Aug 19:25 2014

### IPython inputhook, higher rate?

I'm using IPython.lib.inputhook to run steps in a simulation (Box2D and pygame). When I run this step in my own loop, I can get many hundred of Hertz. When I use set_inputhook, I can only get 8 Hz. When IPython is integrated with GUI backends (like any of the matplotlib interactive backends), it's very responsive. Is there a setting I'm missing?

Thank you!
Gustavo

def run_from_ipython():
try:
__IPYTHON__
return True
except NameError:
return False

if not run_from_ipython():
while domain.running:
domain.run_step()
else:
from IPython.lib import inputhook

def step():
domain.run_step()
return domain.running

inputhook.set_inputhook(step)

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

28 Aug 03:26 2014

### Launching IPython from external "embedded" Python distribution

I use VisIt (https://wci.llnl.gov/simulation/computer-codes/visit) which includes own Python distribution, that is same version as my system Python - 2.7.5 64-bit. It also exposes it's API through own Python module, and includes PySide and vtk as additional modules.

The program includes regular Python console, which is uncomfortable compared to IPython, so I thought to look for clues. One easy way seemed using visitrc Python script which loads at program startup and is empty by default. I put this code inside:

========================================
import sys
sys.path = sys.path + ['C:\Python27\DLLs', 'C:\Python27\lib\site-packages']

import IPython
IPython.start_ipython(argv=[])
========================================

and I was happy to see IPython prompt when I run the program.

IPython.start_ipython(argv=['qtconsole'])

but that raised error, same as trying to pass any argument to start_ipython() function.

Not knowing what's the problem, I thought to ask for advise if there is something else I could try.

Here is output that's printed if I try to launch qtconsole as explained:

========================================
Error in sys.excepthook:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\IPython\qt\console\qtconsoleapp.py", line
53, in gui_excepthook
old_excepthook(exctype, value, tb)
TypeError: 'NoneType' object is not callable

Original exception was:
Traceback (most recent call last):
File "C:\Users\klo\Documents\VisIt\visitrc", line 6, in <module>
IPython.start_ipython(argv=['qtconsole'])
File "C:\Python27\lib\site-packages\IPython\__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 563, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\IPython\terminal\ipapp.py", line 321, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\IPython\core\application.py", line 381, in initialize
self.parse_command_line(argv)
File "C:\Python27\lib\site-packages\IPython\terminal\ipapp.py", line 316, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 475, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Python27\lib\site-packages\IPython\config\application.py", line 406, in initialize_subcommand
subapp = import_item(subapp)
File "C:\Python27\lib\site-packages\IPython\utils\importstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "C:\Python27\lib\site-packages\IPython\qt\console\qtconsoleapp.py", line 67, in <module>
from IPython.qt.client import QtKernelClient
File "C:\Python27\lib\site-packages\IPython\qt\client.py", line 6, in <module>
from IPython.kernel.channels import (
File "C:\Python27\lib\site-packages\IPython\kernel\__init__.py", line 4, in <module>
from . import zmq
File "C:\Python27\lib\site-packages\IPython\kernel\zmq\__init__.py", line 14, in <module>
check_for_zmq('2.1.11', 'IPython.kernel.zmq')
File "C:\Python27\lib\site-packages\IPython\utils\zmqrelated.py", line 35, in check_for_zmq
import zmq
File "C:\Python27\lib\site-packages\zmq\__init__.py", line 30, in <module>
File "C:\Programs\LLNL\VisIt 2.7.3\lib\Python\lib\ctypes\__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "C:\Programs\LLNL\VisIt 2.7.3\lib\Python\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

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

27 Aug 12:47 2014

### Re: ipython + international characters

Hugo Ahlenius wrote on 2014-05-05:
> I don't remember this being an issue in ipython previously, but I
> recently upgrade my python 2.7.5 installation to ipython 2.0.0 (Windows
> 7 Ultimate).
> The keyboard seems to work fine with special characters, but I can't seem
> to enter any Swedish characters in the interactive prompt (åäöÅÄÖ) - I
> can't even paste them into the prompt!
> Any tips on how to solve this? Is this a pyreadline issue?

I haven't had time to troubleshoot this more until now, but I have now
identified it as an issue with pyreadline: if vi-mode is set, those
characters stop working.

I'll file this as an issue in the pyreadline tracker on github.

Regards,
Hugo

23 Aug 11:17 2014

### Problem using ipython-parallel in conjunction with custom zmq cache server

Hello,

tl;dr: Is there a caveat to using zmq and ipython-parallel in the same code that would explain weird blocking behaviour when doing dview.map?

I am using ipython-parallel to do dview.map(func, tasks) on our SGE-managed cluster to distribute an embarassingly parallel set of tasks (image and video processing), with something like (in pseudo-code):

return some_small_result

Everything works like a charm, even faster than MPI! (Thanks to the non-copying numpy array sends I guess?)

However, things get much slower when I use a "cached" version of func like:

return some_small_result

where read_preprocessing_from_cache hits an in-house zmq-based cache server (simple REQ-REP architecture over tcp on port 5555 of the same machine as the ipython-parallel client).

Using func_with_cache sequentially (built-in map) or using multiprocessing.Pool.map works perfectly (no blocking, fast as expected), but using it with dview.map makes things block for a looong time on every "packet" of tasks like so:
- each engine hits the cache and processes one task in the "normal" amount of time,
- all engines are idle for several dozens of seconds (as shown by top on an engine's host),
- the client is just waiting (not polling or anything, just time.sleep),
- after a while, each engine proceeds to its next task.

I also tried replacing dview.map with a "scatter-execute-gather" pattern and a load-balanced view map, but this did not change anything.

I don't know how to track down what is causing this, as profiling the code where the client and dview are just shows that almost all the time is spent in time.sleep (as expected), and I'm struggling to log what is happening on the engines (any hint on that appreciated btw).

I know this is a very specific problem, and there is not much one can do without seeing the actual code, but I hope that someone can at least "teach me how to fish"

FWIW, my vague intuition would be that there is some global internal state of zmq that is changed either by my read_preprocessing_from_cache code or by ipython-parallel (like a default timeout or something), but this is a shot in the dark made by a blind man with a toy gun so...

FYI, I am on Fedora Core 20 with Anaconda using:
python 2.7.8
pyzmq 14.3.1
ipython 2.1.0 (with default profile and options)

Any help on this would be very much appreciated!

By the way, thanks for all the hard work on ipython

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

23 Aug 03:09 2014

### notebook does not run(execute code) after update to development version

I just updated to the development version of ipython and not ipython,
I followed the instructions on github.
I am able to start ipython notebook and browse directories, open notebooks, create new notebooks. The notebooks open and show that they are busy, hitting shift-return enter a new line rather than executing the cell. Regular ipython works fine.
Help...

Here is what I get when I start ipython notebook
(py34)vincent <at> server4:~$ipython notebook --no-browser --port=5023 [I 20:03:20.616 NotebookApp] Using existing profile dir: '/home/vincent/.ipython/profile_default' [I 20:03:20.700 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js [I 20:03:20.739 NotebookApp] Serving notebooks from local directory: /home/vincent [I 20:03:20.739 NotebookApp] 0 active kernels [I 20:03:20.739 NotebookApp] The IPython Notebook is running at: http://localhost:5023/ Here is just ipython (py34)vincent <at> server4:~$ ipython
Python 3.4.1 |Anaconda 2.0.1 (64-bit)| (default, May 19 2014, 13:02:41)

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

9 Aug 18:20 2014

### Using DirectView.execute to import modules on worker processes

I have looked through the documentation about importing modules on IPython Parallel worker processes, and it seems imports of the form "import foo as bar" are not supported.  However, I found that using DirectView.execute allows me to get around this.  Is this safe, if not what can go wrong?

Here's the code I'm using to import part of the dateutil library and :

from IPython.parallel import Client
ipython_client = Client()
dview = ipython_client.direct_view()
dview.execute('from dateutil import parser as dtparser')

I am only using on my local PC, not a cluster.  After executing the above I can happily run code that uses dtparser using dview.map_sync.  I can rewrite my code to avoid doing this but I'd like to know why I shouldn't use this method.

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

5 Aug 17:48 2014

### Is there a way to upgrade IPython configuration files?

Hi there,

I'm trying to manage my IPython configuration & profiles in a Git repo at
this configuration on any computer (at home, at work, on a VM, etc.).

I know that:

ipython profile create jazz

creates a few IPython configuration files at ~/.ipython/profile_jazz.

For now, I've three files generated by IPython:

- ipython_config.py
- ipython_notebook_config.py
- ipython_qtconsole_config.py

which are the same for my all profiles.

I wonder if there is a way to upgrade a IPython configuration file when there is
a new IPython version. I slightly modified the default IPy config files and I
would like to easily merge my future modifications with a new version of these
files.

Thanks,
Damien G.

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

3 Aug 14:11 2014

### Moving content between Notebooks

Hi all,

I'm building some teaching content out of pre-existing teaching content. Is there any good way to copy cells from one notebook to another?

Right now I'm literally copy-pasting each individual cell's contents into the new cells. This feels like the wrong approach! It's extremely fiddly as the source content is a large number of small cells.

Even if the answer involves editing the JSON files, this would be better than what I'm currently doing. But my understanding is that that is something that's quite fragile, and discouraged?

Thanks for any help!

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

30 Jul 23:00 2014

### Re: IPython-User Digest, Vol 129, Issue 6

On Tue, Jul 29, 2014 at 11:19 PM, wrote:
Send IPython-User mailing list submissions to
ipython-user <at> scipy.org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.scipy.org/mailman/listinfo/ipython-user
or, via email, send a message with subject or body 'help' to
ipython-user-request <at> scipy.org

You can reach the person managing the list at
ipython-user-owner <at> scipy.org

than "Re: Contents of IPython-User digest..."

Today's Topics:

1. Re: IPython Notebooks and Active Learning (Matthew        Brett)
(Mark Bakker)
2. Re: IPython Notebooks and Active Learning (Matthew        Brett)
(Thomas Kluyver)
3. Re: IPython Notebooks and Active Learning (Matthew        Brett)
(Thomas Kluyver)
4. Re: IPython Notebooks and Active Learning (Matthew        Brett)
(Fernando Perez)
5. Re: IPython Notebooks and Active Learning (Matthew        Brett)
(Matthew Brett)
6. check for value in list of columns (Vincent Davis)

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

Message: 1
Date: Tue, 29 Jul 2014 22:50:39 +0200
From: Mark Bakker <markbak <at> gmail.com>
Subject: Re: [IPython-User] IPython Notebooks and Active Learning
(Matthew        Brett)
To: ipython-user <at> scipy.org
Message-ID:
<CAEX=yaaZ23V9cpBYdCMUnY8kttF_B4KNHfMPX9M99xr9+sytZw <at> mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

We have developed a series of 15 Notebooks for scientists and engineers who
want to use Python programming for exploratory computing, scipting, data
analysis, and visualization. No prior knowledge of computer programming is
assumed. Each Notebook covers a specific topic and includes a number of
exercises. The exercises should take less than 4 hours to complete for each
Notebook.

We have developed these Notebooks for an undergraduate class (sophomores)
in Civil Engineering. A short survey of the students taking the class (~270
of them) showed that the students really liked the class and learned a lot.

The Notebooks may be viewed at
http://mbakker7.github.io/exploratory_computing_with_python/

Hope you find it useful,

Mark Bakker
TU Delft, The Netherlands
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140729/b531c35f/attachment-0001.html

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

Message: 2
Date: Tue, 29 Jul 2014 14:00:05 -0700
From: Thomas Kluyver <takowl <at> gmail.com>
Subject: Re: [IPython-User] IPython Notebooks and Active Learning
(Matthew        Brett)
To: "Discussions about using IPython. http://ipython.org"
<ipython-user <at> scipy.org>
Message-ID:
<CAOvn4qh_riO5a4JgkBziZ4Hd+=x3EZj8NeGnTE47oVjzqZsg7w <at> mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Thanks Mark, that looks very nice. Please do post this to the ipython-dev
list as well - we're gently deprecating the -user list to fold the two into
one.

Best wishes,
Thomas

On 29 July 2014 13:50, Mark Bakker <markbak <at> gmail.com> wrote:

> We have developed a series of 15 Notebooks for scientists and engineers
> who want to use Python programming for exploratory computing, scipting,
> data analysis, and visualization. No prior knowledge of computer
> programming is assumed. Each Notebook covers a specific topic and includes
> a number of exercises. The exercises should take less than 4 hours to
> complete for each Notebook.
>
> We have developed these Notebooks for an undergraduate class (sophomores)
> in Civil Engineering. A short survey of the students taking the class (~270
> of them) showed that the students really liked the class and learned a lot.
>
> The Notebooks may be viewed at
> http://mbakker7.github.io/exploratory_computing_with_python/
>
> Hope you find it useful,
>
> Mark Bakker
> TU Delft, The Netherlands
>
> _______________________________________________
> IPython-User mailing list
> IPython-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140729/f7ab5c8c/attachment-0001.html

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

Message: 3
Date: Tue, 29 Jul 2014 14:00:34 -0700
From: Thomas Kluyver <takowl <at> gmail.com>
Subject: Re: [IPython-User] IPython Notebooks and Active Learning
(Matthew        Brett)
To: "Discussions about using IPython. http://ipython.org"
<ipython-user <at> scipy.org>
Message-ID:
<CAOvn4qhOodiu=XD_eg7_5ny6SNZv_=0xcxwt0mmj5fpR2yggpA <at> mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On 29 July 2014 14:00, Thomas Kluyver <takowl <at> gmail.com> wrote:

> Thanks Mark, that looks very nice. Please do post this to the ipython-dev
> list as well - we're gently deprecating the -user list to fold the two into
> one.
>
> Best wishes,
> Thomas
>
>
> On 29 July 2014 13:50, Mark Bakker <markbak <at> gmail.com> wrote:
>
>> We have developed a series of 15 Notebooks for scientists and engineers
>> who want to use Python programming for exploratory computing, scipting,
>> data analysis, and visualization. No prior knowledge of computer
>> programming is assumed. Each Notebook covers a specific topic and includes
>> a number of exercises. The exercises should take less than 4 hours to
>> complete for each Notebook.
>>
>> We have developed these Notebooks for an undergraduate class (sophomores)
>> in Civil Engineering. A short survey of the students taking the class (~270
>> of them) showed that the students really liked the class and learned a lot.
>>
>> The Notebooks may be viewed at
>> http://mbakker7.github.io/exploratory_computing_with_python/
>>
>> Hope you find it useful,
>>
>> Mark Bakker
>> TU Delft, The Netherlands
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User <at> scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140729/5b3367d1/attachment-0001.html

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

Message: 4
Date: Tue, 29 Jul 2014 14:01:59 -0700
From: Fernando Perez <fperez.net <at> gmail.com>
Subject: Re: [IPython-User] IPython Notebooks and Active Learning
(Matthew        Brett)
To: "Discussions about using IPython. http://ipython.org"
<ipython-user <at> scipy.org>
Message-ID:
<CAHAreOpcme-X3YvMwXaaJ5WLV2V31nu_0ncGXS=KS-8ru+a8vg <at> mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

These look great! Could I ask you to add them to the gallery in the
relevant section, along with any other relevant links for them?  They will
be more easily found that way in the future:

https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks#entire-books-or-other-large-collections-of-notebooks-on-a-topic

Cheers

f

On Tue, Jul 29, 2014 at 1:50 PM, Mark Bakker <markbak <at> gmail.com> wrote:

> We have developed a series of 15 Notebooks for scientists and engineers
> who want to use Python programming for exploratory computing, scipting,
> data analysis, and visualization. No prior knowledge of computer
> programming is assumed. Each Notebook covers a specific topic and includes
> a number of exercises. The exercises should take less than 4 hours to
> complete for each Notebook.
>
> We have developed these Notebooks for an undergraduate class (sophomores)
> in Civil Engineering. A short survey of the students taking the class (~270
> of them) showed that the students really liked the class and learned a lot.
>
> The Notebooks may be viewed at
> http://mbakker7.github.io/exploratory_computing_with_python/
>
> Hope you find it useful,
>
> Mark Bakker
> TU Delft, The Netherlands
>
> _______________________________________________
> IPython-User mailing list
> IPython-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>

--
Fernando Perez ( <at> fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140729/db6179f3/attachment-0001.html

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

Message: 5
Date: Tue, 29 Jul 2014 17:16:31 -0400
From: Matthew Brett <matthew.brett <at> gmail.com>
Subject: Re: [IPython-User] IPython Notebooks and Active Learning
(Matthew        Brett)
To: "Discussions about using IPython. http://ipython.org"
<ipython-user <at> scipy.org>, IPython Development list
<ipython-dev <at> scipy.org>
Message-ID:
<CAH6Pt5oU3nVgJt4uA6c3g0fXrAB5FW+bThm2bsXH8DDK-MZKAA <at> mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

On Tue, Jul 29, 2014 at 4:50 PM, Mark Bakker <markbak <at> gmail.com> wrote:
> We have developed a series of 15 Notebooks for scientists and engineers who
> want to use Python programming for exploratory computing, scipting, data
> analysis, and visualization. No prior knowledge of computer programming is
> assumed. Each Notebook covers a specific topic and includes a number of
> exercises. The exercises should take less than 4 hours to complete for each
> Notebook.
>
> We have developed these Notebooks for an undergraduate class (sophomores) in
> Civil Engineering. A short survey of the students taking the class (~270 of
> them) showed that the students really liked the class and learned a lot.
>
> The Notebooks may be viewed at
> http://mbakker7.github.io/exploratory_computing_with_python/

Thanks a lot for this.   From our feedback, our students liked the
notebooks too - e.g.

what the code is and does - will be a great reference"

I think there's really no question that the notebooks make running
code examples easier and clearer for the teacher and the student.  And
they are indeed a great reference.   The question always is - what do
we want to teach?  In some cases it's probably enough that the
students get the idea, and running / writing code in the notebooks
helps them get the idea.   But the students also implicitly learn that
this is the standard way of working with code, and I personally don't
think we should be teaching that.  So, for me at least, I am trying to
find a way to strike a balance between the ease of writing materials /
ease of getting students running code, and the need for teaching solid
working practice. For example, for the next iteration of our course,
I'm thinking of doing a flipped classroom format, with the tutorials
mostly in IPython notebooks, but doing the exercises in class using
text editor and terminal and git.  I'd also like to try and teach the
IPython notebook as a great tool for sharing and explaining a
workflow, or developing a tutorial.

Cheers,

Matthew

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

Message: 6
Date: Tue, 29 Jul 2014 15:32:16 -0600
From: Vincent Davis <vincent <at> vincentdavis.net>
Subject: [IPython-User] check for value in list of columns
To: ipython <ipython-user <at> scipy.org>
Message-ID:
<CALyJZZVwRYT-xNhkLmAHRhGF3GKe2QyyMgAJt0WfvYjNzfnmWw <at> mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I have data that looks like this
VMONTH VDAYVYEAR MED1MED2 MED3MED4 MED5PATWT PATCODE 010 1593 6073524355
3384316475 999595686 11 1015 9310126 578917165 9000090000 956862 210 1593
578919675 3055390000 9000095686 33 1015 9360735 1786534495 9000090000 956864
410 1593 196755810 9000090000 9000095686 5

?I want to create a new bool column "med" that has True/False based on  ?60735
in the columns MED1...MED5
I am trying this and am not sure why it does not work.
DF['med'] = (60735 in [DF['MED1'], DF['MED1']])

ValueError: The truth value of a Series is ambiguous. Use a.empty,
a.bool(), a.item(), a.any() or a.all()

Vincent Davis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140729/77e6d649/attachment.html

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

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

End of IPython-User Digest, Vol 129, Issue 6
********************************************

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


Gmane