ipython

Releasing memory of huge numpy array in IPython

南笙酒味 提交于 2019-12-20 08:33:51
问题 UPDATE:- This problem solved itself after a machine reboot. Not yet able to figure out why this error was happening before. I have a function that loads a huge numpy array (~ 980MB) and returns it. When I first start Ipython and call this function, it loads the array into the variable without any problem. But if I run the same command again, it exits raising a "Memory Error". I tried the following, del hugeArray Still the same error was occurring. I even tried the following del hugeArray gc

Getting wider output in PyCharm's built-in console

青春壹個敷衍的年華 提交于 2019-12-20 08:27:34
问题 I'm relatively new to using the PyCharm IDE, and have been unable to find a way to better shape the output when in a built-in console session. I'm typically working with pretty wide dataframes, that would fit easily across my monitor, but the display is cutting and wrapping them much sooner than needed. Does anyone know of a setting to change this behavior to take advantage of the full width of my screen? Edit: I don't have enough reputation to post a screenshot, but link is below: http:/

Logging module sample code repeats messages n-times-each call

耗尽温柔 提交于 2019-12-20 06:26:53
问题 I'm surprised by the output from Python's logging module. I wrote up the Python.org's How-To for Logging. When I run the sample code, there is a lot of (confusing) duplication. The StreamHandler duplicates the log messages, one for each time I reload the file in iPython with the magic %run In [4]: %run main.py 2018-05-11 2127:33 - WARNING - 3. This is a warning, yous! 2018-05-11 2127:33 - ERROR - 4. Here is an error 2018-05-11 2127:33 - CRITICAL - 5. This is f-ing critical! [...] In [7]: %run

atexit function is not called when exiting the script using Ipython

泪湿孤枕 提交于 2019-12-20 04:49:09
问题 Below is the code written in a script say test_atexit.py def exit_function(): print "I am in exit function" import atexit atexit.register(exit_function) print "I am in main function" When i run the function using python2.4 then exit_function is being called $python2.4 test_atexit.py I am in main function I am in exit function When i run the same using ipython then exit_function is not being called $ ipython In [1]: %run test_atexit.py I am in main function In [2]: why exit_function is not

atexit function is not called when exiting the script using Ipython

最后都变了- 提交于 2019-12-20 04:49:08
问题 Below is the code written in a script say test_atexit.py def exit_function(): print "I am in exit function" import atexit atexit.register(exit_function) print "I am in main function" When i run the function using python2.4 then exit_function is being called $python2.4 test_atexit.py I am in main function I am in exit function When i run the same using ipython then exit_function is not being called $ ipython In [1]: %run test_atexit.py I am in main function In [2]: why exit_function is not

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

孤街浪徒 提交于 2019-12-20 04:25:07
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

北战南征 提交于 2019-12-20 04:25:04
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

Syntax error in jinja 2 library

梦想的初衷 提交于 2019-12-20 04:19:07
问题 For running the IPython Notebook on a suse Linux server, I needed to install the jinja2 library: pip-3.2 install jinja2 Installation printed a syntax error but also said "installation successful". On import, I get the following error: In [1]: import jinja2 File "/usr/local/lib/python3.2/site-packages/jinja2/environment.py", line 639 u'\xff\xff\xff\xff'.encode('iso-8859-15') ^ SyntaxError: invalid syntax Bug in the jinja2 package? Any way for me to fix this? 回答1: Jinja2 only supports Python 3

I have the following error. How to fix the following certificate error (ipython)?

和自甴很熟 提交于 2019-12-20 04:12:58
问题 I'm getting the following error when I want to run ipython notebook on my macbook. Does anyone know how to fix this? Could you please help me about it? ERROR:root:Exception in I/O handler for fd 6 Traceback (most recent call last): File "//anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start self._handlers[fd](fd, events) File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 167, in accept_handler callback(connection, address) File "//anaconda/lib

IPython change input cell syntax highlighting logic for entire session

戏子无情 提交于 2019-12-20 03:57:12
问题 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 be displayed with some chosen, non-Python syntax highlighting (regardless of any magics used on a cell, regardless of whether the cell embodies Python code, some other language). In my case I