ipython

Jupyter Notebook Broken by Python 3.5

天大地大妈咪最大 提交于 2019-12-23 09:37:41
问题 When I updated my Python version from 3.4 to 3.5 (on Mac El Capitan), I reinstalled Jupyter but when I run it and create a new Python 3 notebook, it immediately tells me that there has been a kernel error and if I click on this, then I get this error message: Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/notebook/base/handlers.py", line 436, in wrapper result = yield gen.maybe_future(method(self, *args, **kwargs)) File "/usr/local/lib/python3.5/site-packages

Is path broken for anaconda ipython?

一世执手 提交于 2019-12-23 09:30:06
问题 I wish to use anaconda distribution of ipython, but typing ipython at the terminal produces an error message: Traceback (most recent call last): File "/usr/local/bin/ipython", line 5, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module> working_set.require(__requires__) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",

if __name__ == '__main__' not working ipython

江枫思渺然 提交于 2019-12-23 09:27:32
问题 I'm having trouble getting the if __name == '__main__' trick to work in an IPython, Spyder environment. I've tried every approach given in this thread: if __name__ == '__main__' in IPython Here are my super simplified modules Module1.py Class UnitTest(): print 'Mod1 UnitTest!' if __name__ == '__main__': UnitTest() Module2.py import Module1 Class UnitTest(): print 'Mod2 UnitTest!' if __name__ == '__main__': UnitTest() So I run Module2.py and I always am seeing both Mod2 UnitTest and Mod1

How to represent graphs with IPython

南笙酒味 提交于 2019-12-23 08:33:38
问题 Recently I discovered IPython notebook which is a powerful tool. As an IT student, I was looking for a way to represent graphs in Python. For example, I would like to know if there's a library (like numpy or matplotlib ?) which can draw from this { "1" : ["3", "2"], "2" : ["4"], "3" : ["6"], "4" : ["6"], "5" : ["7", "8"], "6" : [], "7" : [], "8" : [] } something like this : Is there something like this ? 回答1: You can use networkx and, if you need to render the graph in ipython notebook, nxpd

“ValueError: _type_ 'v' not supported” error after installing PyReadline

人走茶凉 提交于 2019-12-23 08:05:06
问题 After I installed PyReadline, IPython won't work. When I uninstalled it, it starts working again. The stack trace for ipython: (py2.7_monitor)[root@vm10-136-8-98 monitor]# ipython WARNING: IPython History requires SQLite, your history will not be saved Traceback (most recent call last): File "/home/py2.7_monitor/bin/ipython", line 11, in <module> sys.exit(start_ipython()) File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/__init__.py", line 118, in start_ipython return launch_new

git push error due to non-existent large file

江枫思渺然 提交于 2019-12-23 07:59:22
问题 I keep getting the same result when trying to push to git: Counting objects: 78, done. Delta compression using up to 4 threads. Compressing objects: 100% (67/67), done. Writing objects: 100% (71/71), 36.29 MiB | 637.00 KiB/s, done. Total 71 (delta 39), reused 0 (delta 0) remote: error: GH001: Large files detected. remote: error: Trace: 7e446266168df8617c74b6a319ec4538 remote: error: See http://git.io/iEPt8g for more information. remote: error: File lecture_2_github_io_numpy_pandas/data

Jupyter notebook does not print logs to the output cell

安稳与你 提交于 2019-12-23 07:47:27
问题 I am currently using Jupyter notebook and I would like to force it to print out Python logs to the output cell. I am using old notebook that used to work this way, probably in older version of Jupyter notebook. I have logging set as: import logging logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO) logging.root.level = 20 But when I then call: logging.info("hello world") It does not print anything in the output cell. It just prints out the stuff in the console in

Problems when showing Interpreter (IPython) after running Program in PyCharm

妖精的绣舞 提交于 2019-12-23 06:47:05
问题 I have PyCharm Professional Edition 3.5 5.0 configured to use IPython when possible and in my Run/Debug Configurations I set show interpreter afterwards I use the interactive Interpreter a lot and I really like IPython, but there are some things that I don't like about the way this is handled in PyCharm: any input() in my programs return empty strings. Additionally, when an error occurs I can't interact with the Program anymore. (you can when you run a Python program with the -i flag) There

Writing multiple csv's from a function [closed]

巧了我就是萌 提交于 2019-12-23 04:49:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Let's say that I have a function which creates a pd.DataFrame according to some variable 'name': def function(name): ... ... ... return(DataFrame(name)) #parenthesis #here only to show that the DataFrame will be #different when a different name is given as input. My question is:

How can i split 'Date' column into 'Date' and 'Time' column? [closed]

一曲冷凌霜 提交于 2019-12-23 03:47:50
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . In the image shown, how can i split 'Date' column into 'Date' and 'Time' column? ' 回答1: You can use str.split by whitespace what is default separator: df = pd.DataFrame({'Date':['4/1/2016 0.00','4/2/2016 0.05']}) print (df) Date 0 4/1/2016 0.00 1 4/2/2016 0.05 df[['Date','Time']] = df.Date.str