ipython

How to override ipython displayhook?

这一生的挚爱 提交于 2019-12-18 08:47:08
问题 I have defined my own displayhook that inherits from IPython.core.displayhook.DisplayHook. I was unable to find any resources online as for the proper way of overriding the displayhook for an IPython shell. Currently, I am doing the following in ~/.ipython/profile_default/startup/imports.py: ipyShell = IPython.get_ipython() ipyShell.displayhook = MyDisplayHook(shell=ipyShell) ipyShell.displayhook_class = MyDisplayHook sys.displayhook = ipyShell.displayhook Which does not work, as after the

How to override ipython displayhook?

我们两清 提交于 2019-12-18 08:47:06
问题 I have defined my own displayhook that inherits from IPython.core.displayhook.DisplayHook. I was unable to find any resources online as for the proper way of overriding the displayhook for an IPython shell. Currently, I am doing the following in ~/.ipython/profile_default/startup/imports.py: ipyShell = IPython.get_ipython() ipyShell.displayhook = MyDisplayHook(shell=ipyShell) ipyShell.displayhook_class = MyDisplayHook sys.displayhook = ipyShell.displayhook Which does not work, as after the

How can I reload objects in my namespace in ipython [duplicate]

可紊 提交于 2019-12-18 04:29:18
问题 This question already has answers here : Reloading submodules in IPython (12 answers) Closed 3 years ago . After import functions into ipython, how do I reload them when I have modified them outside of ipython ? 回答1: Python 2: reload(module) Python 3: from importlib import reload reload(module) Where module is the file with your functions. 回答2: you can also use autoreload, so that the modules you are working on are automatically reloaded at each statement, pretty handy for debugging, see:

Adding Color to new style ipython (v5) prompt

拈花ヽ惹草 提交于 2019-12-18 04:08:26
问题 Update to the newly release ipython5 today. Started up the interactive prompt and received: /usr/local/lib/python3.5/site-packages/IPython/core/interactiveshell.py:440: UserWarning: As of IPython 5.0 `PromptManager` config will have no effect and has been replaced by TerminalInteractiveShell.prompts_class warn('As of IPython 5.0 `PromptManager` config will have no effect' Yanked out my old config settings to customize and colorize the prompt and went looking for the new way to customize the

Plot pandas dataframe containing NaNs

走远了吗. 提交于 2019-12-18 03:56:10
问题 I have GPS data of ice speed from three different GPS receivers. The data are in a pandas dataframe with an index of julian day (incremental from the start of 2009). This is a subset of the data (the main dataset is 3487235 rows...): R2 R7 R8 1235.000000 116.321959 100.805197 96.519977 1235.000116 NaN 100.771133 96.234957 1235.000231 NaN 100.584559 97.249262 1235.000347 118.823610 100.169055 96.777833 1235.000463 NaN 99.753551 96.598350 1235.000579 NaN 99.338048 95.283989 1235.000694 113

Plot pandas dataframe containing NaNs

喜欢而已 提交于 2019-12-18 03:56:03
问题 I have GPS data of ice speed from three different GPS receivers. The data are in a pandas dataframe with an index of julian day (incremental from the start of 2009). This is a subset of the data (the main dataset is 3487235 rows...): R2 R7 R8 1235.000000 116.321959 100.805197 96.519977 1235.000116 NaN 100.771133 96.234957 1235.000231 NaN 100.584559 97.249262 1235.000347 118.823610 100.169055 96.777833 1235.000463 NaN 99.753551 96.598350 1235.000579 NaN 99.338048 95.283989 1235.000694 113

Unable to load DLL python module in PyCharm. Works fine in IPython

拟墨画扇 提交于 2019-12-18 03:43:21
问题 When I use the IPython included with Enthought Python Distribution, I can import the pyvision package just fine. However, when I try to import pyvision inside of PyCharm 1.2.1, I get the following errors File "C:\Python27\lib\site-packages\pyvision\__init__.py", line 146, in <module> from pyvision.types.img import Image,OpenCVToNumpy,NumpyToOpenCV File "C:\Python27\lib\site-packages\pyvision\types\img.py", line 43, in <module> import numpy File "C:\Python27\lib\site-packages\numpy\__init__.py

Packages from Conda env not found in Jupyer Notebook

家住魔仙堡 提交于 2019-12-18 02:42:29
问题 I created an environment called imagescraper and installed pip with it. I then proceed to use pip to install a package called ImageScraper; >>activate imagescraper [imagescraper]>>pip install ImageScraper Just to ensure that I have the package successfully installed: >>conda list [imagescraper] C:\Users\John>conda list # packages in environment at C:\Anaconda2\envs\imagescrap # future 0.15.2 <pip> imagescraper 2.0.7 <pip> lxml 3.6.0 <pip> numpy 1.11.0 <pip> pandas 0.18.0 <pip> pip 8.1.1 py27

Reusing code from different IPython notebooks

冷暖自知 提交于 2019-12-17 22:12:56
问题 I am using IPython and want to run functions from one notebook from another (without cutting and pasting them between different notebooks). Is this possible and reasonably easy to do? 回答1: You can connect with a qtconsole to the same kernel. Just supply this at startup: ipython qtconsole --existing kernel-0300435c-3d07-4bb6-abda-8952e663ddb7.json Look at the output after starting the notebook for the long string. 回答2: Starting your notebook server with: ipython notebook --script will save the

iPython Code Completion / Intellisense on Dot Possible?

时间秒杀一切 提交于 2019-12-17 22:11:36
问题 As someone trying to learn the ins and outs of Python (with emphasis on scientific computing - ie: pandas, numpy, scikit-learn), most of the gurus out there seem to recommend and use iPython notebooks. My biggest sticking point as a beginner/intermediate coder is that I NEED code completion / intellisense -like functionality from an IDE to learn the function parameters. I'm not hard-wired yet to just know what parameters are available at my current development. In iPython, I noticed I can