spyder

How do I run two separate instances of Spyder

六月ゝ 毕业季﹏ 提交于 2019-12-20 08:36:21
问题 I want to be able to have two instances which are completely independent in the sense that I can be working on two separate unrelated projects in different folders without any interference. 回答1: ( Spyder dev here ) This is very easy. You need to go to: Tools > Prefences > General and click "Advanced Settings" tab, and deactivate the option called [ ] Use a single instance Then every time you start Spyder a new window will be opened. If you want the old behavior back, just activate that option

Remove a tuple containing nan in list of tuples — Python

▼魔方 西西 提交于 2019-12-20 05:13:31
问题 I have a long list of tuples and want to remove any tuple that has a nan in it using Python. What I currently have: x = [('Recording start', 0), (nan, 4), (nan, 7), ..., ('Event marker 1', 150)] Result I'm looking for: x = [('Recording start', 0), ('Event marker 1', 150)] I've tried use np.isnan and variants of that, but have had no success and keep getting an error: ufunc 'isnan' is not supported for the input types, and the inputs could not be safely coerced to any supported types according

Remove a tuple containing nan in list of tuples — Python

心已入冬 提交于 2019-12-20 05:13:04
问题 I have a long list of tuples and want to remove any tuple that has a nan in it using Python. What I currently have: x = [('Recording start', 0), (nan, 4), (nan, 7), ..., ('Event marker 1', 150)] Result I'm looking for: x = [('Recording start', 0), ('Event marker 1', 150)] I've tried use np.isnan and variants of that, but have had no success and keep getting an error: ufunc 'isnan' is not supported for the input types, and the inputs could not be safely coerced to any supported types according

The Anaconda prompt freezes when I run code with numba's “jit” decorator

拥有回忆 提交于 2019-12-20 04:16:02
问题 I have this python code that should run just fine. I'm running it on Anaconda's Spyder Ipython console, or on the Anaconda terminal itself, because that is the only way I can use the "numba" library and its "jit" decorator. However, either one always "freezes" or "hangs" just about whenever I run it. There is nothing wrong with the code itself, or else I'd get an error. Sometimes, the code runs all the way through perfectly fine, sometimes it just prints the first line from the first function

problems exiting from Python using iPython/Spyder

浪尽此生 提交于 2019-12-20 02:51:07
问题 This question has been asked before, but I have tried the solutions in related questions such as this to no avail. I am having problems with Python's exit command, and I have ruled out a problem with my code as run by vanilla Python 3. The problem comes when I run it with iPython or in Spyder's iPython console. When I use just a simple exit command, I get the error: NameError: name 'exit' is not defined I have already imported sys as suggested by the other link. The only thing that kind of

How to reset Spyder IDE (Python 2.7) graphic user interface?

懵懂的女人 提交于 2019-12-19 05:50:07
问题 I am trying to reset the interface I have tried to misaligned. I couldn't find it in settings. I have also tried uninstalling and reinstalling it. No luck. Can you help me to reset it? Thanks. 回答1: (Spyder-dev here) We will include a way to reset spyder configuration from within the user interface in the upcoming version (3.0.0). In the meantime you can reset by opening a terminal window (cmd in windows.. shell in Mac/Linux) and typing spyder --reset If that still does not work you can erase

How to run current line in Spyder 3.5( ctrl +f10 not working)

好久不见. 提交于 2019-12-19 05:04:42
问题 I am very new to Python and I am used to R studio so I choose Spyder. On the Spyder layout I saw a button 'run current line (ctrl +f10)'. But it doesn't work by pressing the button or c+10. Am I missing something? I can only select the script and 'ctrl+enter ' to run current line which is not convenient at all. I am using ubuntu with Anaconda distribution. 回答1: The key to run the current line by itself is F9 . The shortcut ctrl+F10 is used if you are in debugging mode. You can see a list of

In Spyder, plot using Matplotlib with interactive zoom, etc

[亡魂溺海] 提交于 2019-12-18 18:58:12
问题 I've recently switched from Enthought Canopy to Anaconda and am using the Spyder IDE. I've noticed that when I plot some data, import matplotlib.pyplot as plt plt.figure() plt.plot(rigs2) plt.ion() plt.show() It shows up as an inline figure in the IPython console: However, in Enthought it used to be that the plot would show up in a separate window with zoom, back, and forward buttons. Is there any way to achieve the same in Spyder? 回答1: Select from the menu Tools > Preferences , then IPython

How to tell Spyder's style analysis PEP8 to read from a setup.cfg or increase max. line length?

Deadly 提交于 2019-12-18 18:54:15
问题 I am using Spyder 2.3.1 and python(x, y). In the preferences of Spyder you can activate "Style analysis". This is quite nice, but I want to increase the max. tolerable line length. The standard setting for PEP8 is 79 characters. This can be changed through a setup.cfg with the content: [pep8] max-line-length = 99 This can be read here: http://pep8.readthedocs.org/en/latest/intro.html#related-tools Where do I put a setup.cfg so Spyder/PEP8 will recognize my new limit? Or is there an other way

Stepwise debugging of selected Python code

末鹿安然 提交于 2019-12-18 16:59:39
问题 The essence: Using Spyder, it's possible to run parts of code by highlighting it and clicking F9 . This works with For Loops as well, but the problem (for me at least) is that it seems impossible to run the selected part step by step . I find this a bit strange since it's possible to run For Loops step by step under other cirmustances (and inspect the state of the variables at each step). Allow me to explain: The snippet below is an operation on two variables names = ['A', 'B', 'C'] and