Vincent Davis | 29 Jul 23:32 2014
Picon

check for value in list of columns

I have data that looks like this
VMONTH VDAYVYEAR MED1MED2 MED3MED4 MED5PATWT PATCODE 01 23 4
10 15 93 60735 24355 33843 16475 9995 95686 1
10 15 93 10126 5789 17165 90000 90000 95686 2
10 15 93 5789 19675 30553 90000 90000 95686 3
10 15 93 60735 17865 34495 90000 90000 95686 4
10 15 93 19675 5810 90000 90000 90000 95686 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

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Brian E Chapman | 28 Jul 22:53 2014
Picon

IPython Notebooks and Active Learning

Hello,

We are developing a medical data science curriculum based on Python using Ipython notebooks as a key part of the curriculum. Is anyone aware of studies that have been done evaluating the Ipython notebooks in terms of how well they promote active learning by the students using them?

Thanks,

Brian
— 
Brian E. Chapman, Ph.D.
Associate Professor
Department of Radiology
University of Utah

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
minotaurs | 25 Jul 22:22 2014
Picon

Multiprocessing on existing iPython 2.7 code

Hey, is it possible to use multiple cores to do calculations on an existing
iPython 2.7 code? And if it is than how?

--
View this message in context: http://python.6.x6.nabble.com/Multiprocessing-on-existing-iPython-2-7-code-tp5065153.html
Sent from the IPython - User mailing list archive at Nabble.com.
klo uo | 25 Jul 01:39 2014
Picon

Embedding Qt widgets

Is it easily possible to embed Qt Widget inside IPython Qt console?

I would guess that it's not possible at all, and that I can only render html items, but anyway thought to ask.

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Davide Lasagna | 4 Jul 16:39 2014
Picon

Persistent storage of cell computations

Hi all!

Have a question. Is there any built-in cell magic that gives sort of persistent storage for the computations in the cell itself? Basically, my notebooks tend to be split in computation and visualisation parts, and I would like some robust and built-in way to save computations between runs, something similar to what Joblib Memory class provides,just within IPython. I think It would be great to have it. How difficult is to program it, BTW? 

Also, Can you point me in the right spot in the docs where I can get a basic idea of the API for creating this sort of magic by myself? 

Thanks, 

Davide
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Konrad Hinsen | 23 Jun 12:31 2014
Picon

"Connection failed" after updating to IPython 2.1

Hi everyone,

I just updated my Anaconda installation, which included an update from
IPython 2.0 to IPython 2.1. Since then, I cannot access my notebooks
with Firefox or Chrome any more ("connection failed"), though Safari
continues to work. Further system details: MacOS 10.9.3, Python 2.7.7,
and thanks to Anaconda all the dependencies should be up to date.

Since many packages were updated together with IPython, I did a test
install in a different (very plain) Python 2.7 installation, and
verified that it is indeed IPython 2.1 that makes the difference.

Does anyone have an idea what to do about this?

Konrad.
Xīcò | 21 Jun 01:12 2014

Random failures and write errors in tornado

Dear ipython-user,

I am trying to setup a notebook accessible via http on a FreeBSD server. 
Unfortunately, I am having quite a bit of trouble in getting a decently 
working installation. Indeed, there seem to be some problems in getting 
the notebook and the kernels working together, from time to time, the 
cells are not evaluated, or new notebooks cannot be created, and the 
kernel become unaccessible. It appears to be related to this log 
message:

   WARNING:tornado.general:Write error on 24: [Errno 1] Operation not 
permitted

where the 24 is an arbitrary variable part.

I am not able to get more useful information by setting 
log_level='DEBUG':

   DEBUG:tornado.access:200 PUT /api/notebooks/Untitled0.ipynb 
(66.27.70.10) 238.73ms
   2014-06-20 22:58:25.966 [NotebookApp] Polling kernel...
   2014-06-20 22:58:28.934 [NotebookApp] Polling kernel...
   [IPKernelApp]
   *** MESSAGE TYPE:execute_request***
   [IPKernelApp]    Content: {'store_history': True, 'user_variables': 
[], 'allow_stdin': True, 'user_expressions': {}, 'code': "n, tau = 8, 
85.0  [TRUNCATED FOR THE EMAIL]", 'silent': False}
      --->

   [IPKernelApp] {'msg_id': 'aea6748f-d4e2-426d-b639-1c74b15208cf', 
'metadata': {'dependencies_met': True, 'started': 
datetime.datetime(2014, 6, 20, 22, 58, 31, 452209), 'engine': 
'acc96002-65c5-47aa-949e-0c9cb74b87a3', 'status': 'ok'}, 
'parent_header': {'msg_id': 'F7A5EBC0FBE349FF882A92950C64FC25', 
'username': 'username', 'session': '1B6F8561F91246BA9928B5A5DEBA6132', 
'msg_type': 'execute_request'}, 'content': {'payload': [], 
'execution_count': 10, 'status': 'ok', 'user_variables': {}, 
'user_expressions': {}}, 'header': {'msg_id': 
'aea6748f-d4e2-426d-b639-1c74b15208cf', 'username': 'kernel', 'date': 
datetime.datetime(2014, 6, 20, 22, 58, 31, 720530), 'session': 
'919e9995-ad23-436e-a059-01c42b3b2faf', 'msg_type': 'execute_reply'}, 
'msg_type': 'execute_reply', 'tracker': 
<zmq.sugar.tracker.MessageTracker object at 0x8082515c0>}
   WARNING:tornado.general:Write error on 23: [Errno 1] Operation not 
permitted
   2014-06-20 22:58:31.886 [NotebookApp] Polling kernel...
   2014-06-20 22:58:35.053 [NotebookApp] Polling kernel...
   2014-06-20 22:58:38.013 [NotebookApp] Polling kernel...

As for the configuration of the notebook, I simply used the command 
"ipython profile create" and updated ipython_notebook_config.py to avoid 
getting another kind of unsupported protocol errors (the notebook wanted 
to got ipv6). Basically, I simply set:

   c.NotebookApp.ip = '192.168.1.10'
   c.NotebookApp.port = 9200
   c.KernelManager.ip = '192.168.1.10'

I also tried with SSL, password and different log_levels, without luck. 
If anyone could give me some hints on how to get more debugging, that 
would be greatly appreciated.

Best regards,

--
Xīcò
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Christoph Groth | 6 Jun 16:13 2014

autoscrolling such that the selected cell remains visible

Dear all,

Thank you for the recent changes that made the ipython notebook 
much more keyboard-friendly.

I would like to make a suggestion that IMHO would make interaction 
with the notebook even more fluid: The notebook window could 
scroll such that the selected cell always remains completely 
visible (whenever possible, i.e. whenever that cell fits into the 
window).

Already now when moving from cell to cell with the keyboard the 
browser window scrolls to make cells visible.  But this is not 
true for _partially_ visible cells.  (At least not for me with 
IPython 2.1 and Firefox 24.)  Imagine the case where the user 
moves through the notebook with the keyboard and arrives at the 
last cell.  Currently, to make it completely visible, one needs to 
press another key (either page-down, or insert cell below).

The selected=visible principle could be also applied to cells in 
evaluation:  Once the output of the selected cell appears, I think 
it would make sense to scroll such that the now larger cell 
remains completely visible.

Another application: Currently, appearing output of inactive cells 
can move the selected cell out of view.  Would it be possible to 
scroll to keep the selected cell visible also in this case?

All the best,
Christoph
Christoph Groth | 6 Jun 12:48 2014

Enabling codemirror addons in the ipython notebook

Hello,

So far I've been unable to enable codemirror addons for the 
ipython notebook.  I suppose that it should be possible to do it 
inside custom.js somehow.  How to enable trailingspace.js for 
example?

Thanks,
Christoph
Irwin Zaid | 4 Jun 19:37 2014

Set maximum size of widgets in ContainerWidget?

Hi all,

I've been playing around with IPython 2.0, and I think the new widgets 
are great! I'm now starting to customize some of them to my needs, which 
brings me to my question...

If I make a ContainerWidget that contains a bunch of, say, 
FloatTextBoxWidgets, each FloatTextBoxWidget is a different length 
depending on the length of the description. I'd like to harmonise them, 
is there a way to do this?

I thought setting 'max-width' in the css would do it, but it seems to be 
ignored for widgets in a ContainerWidget.

Thanks,

Irwin
gary ruben | 2 Jun 07:28 2014
Picon

IPython-notebook 2.x.x crashing on Windows 32

Hi,

Since IPython 2.x.x I haven't been able to run IPython notebook on my work machine, which is running Anaconda Python 32 bit in Windows7 enterprise 64 bit.

I think it is this issue with ZMQ causing the problem
https://code.google.com/p/winpython/issues/detail?id=49

because I see
windows ZMQError: Permission denied
in the crashed console window. The proposed solution according to a couple of threads I've found online is to add a loopback address exception to the Windows firewall, but this hasn't solved the problem for me (although I may have done this incorrectly). It is possible that McAfee is causing problems too. At home I'm running Anaconda Python 64 bit in Windows7 Pro 64 bit with no such problem, but I'm not using McAfee at home.

Any ideas?

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

Gmane