spyder

Plot inline or a separate window using Matplotlib in Spyder IDE

夙愿已清 提交于 2019-11-27 18:59:15
When I use Matplotlib to plot some graphs, it is usually fine for the default inline drawing. However, when I draw some 3D graphs, I'd like to have them in a separate window so that interactions like rotation can be enabled. Can I configure in Python code which figure to display inline and which one to display in a new window? I know that in Spyder, click Tools, Preferences, Ipython Console, Graphics and under Graphics Backend select “automatic” instead of “inline”. However, this make all the figures to be in new windows. It can be messy when I have a lot of plots. So I want only those 3D plot

How to ensure that Spyder runs within a conda environment?

跟風遠走 提交于 2019-11-27 18:08:35
问题 I created a conda environment called testenv in Windows 10 that contains Python 3.6 and Spyder. I also installed Selenium using the method described in this answer. I checked that these packages are installed with conda list -n testenv To run Spyder in that environment I followed the instructions in this answer and its related comments. So I activated the environment with activate testenv which modified the prompt to indicate that testenv is active. Then I typed spyder to launch Spyder. (When

Python Spyder reset

与世无争的帅哥 提交于 2019-11-27 13:48:57
问题 I was using python(x,y), which came with Spyder. Yesterday, Spyder crashed I can't figure it out how to fix it. I uninstalled python(x,y) and reinstalled, still the same problem. If I try to open Spyder I get this message: Spyder crashed during last session If Spyder does not start at all and before submitting a bug report, please try to reset setting to defaults by running Spyder with the command line option '--reset: python spyder --reset Of course, I tried to do the above, but it doesn't

Python Pandas - Missing required dependencies ['numpy'] 1

孤人 提交于 2019-11-27 12:18:06
Since yesterday I've had this error when I try to import packages on anaconda : ImportError: Missing required dependencies ['numpy'] I have tried un-installing Anaconda and Python, switching to Python 2.7 but nothing works it's still the same error, here is the code I get : Any help is really appreciated thanks ! I had this same issue immediately after upgrading pandas to 0.19.2. I fixed it with the following install/uninstall sequence from the windows cmd line: pip uninstall pandas pip uninstall numpy pip install pandas pip install numpy This also broke my matplotlib install so I uninstalled

How do I get interactive plots again in Spyder/IPython/matplotlib?

試著忘記壹切 提交于 2019-11-27 10:29:01
I upgraded from Python(x,y) 2.7.2.3 to 2.7.6.0 in Windows 7 (and was happy to see that I can finally type function_name? and see the docstring in the Object Inspector again) but now the plotting doesn't work as it used to. Previously (Spyder 2.1.9, IPython 0.10.2, matplotlib 1.2.1), when I plotted this script , for instance, it would plot the subplots side-by-side in an interactive window: Now (Spyder 2.2.5, IPython 1.2.0, Matplotlib 1.3.1) when I try to plot things, it does the subplots as tiny inline PNGs, which is a change in IPython : So I went into options and found this: which seems to

numpy array dtype is coming as int32 by default in a windows 10 64 bit machine

牧云@^-^@ 提交于 2019-11-27 09:26:10
I have installed Anaconda 3 64 bit on my laptop and written the following code in Spyder: import numpy.distutils.system_info as sysinfo import numpy as np import platform sysinfo.platform_bits platform.architecture() my_array = np.array([0,1,2,3]) my_array.dtype Output of these commands show the following: sysinfo.platform_bits Out[31]: 64 platform.architecture() Out[32]: ('64bit', 'WindowsPE') my_array = np.array([0,1,2,3]) my_array.dtype Out[33]: dtype('int32') My question is that even though my system is 64bit, why by default the array type is int32 instead of int64? Any help is appreciated

No multiprocessing print outputs (Spyder)

只愿长相守 提交于 2019-11-27 09:06:31
I have recently started to delve into multiprocessing, as I believe my code can be easily parallelized. Upon working through the tutorials, though, I encountered an issue: functions distributed in a pool do not seem to print. Here's the culprit: __spec__ = None # This line is required for Spyder and not part of the actual example from multiprocessing import Process import os def info(title): print(title) print('module name:', __name__) print('parent process:', os.getppid()) print('process id:', os.getpid()) def f(name): info('function f') print('hello', name) if __name__ == '__main__': info(

downloading error using nltk.download()

别说谁变了你拦得住时间么 提交于 2019-11-27 04:28:33
问题 I am experimenting NLTK package using Python. I tried to downloaded NLTK using nltk.download() . I got this kind of error message. How to solve this problem? Thanks. The system I used is Ubuntu installed under VMware. The IDE is Spyder. After using nltk.download('all') , it can download some packages, but it gets error message when downloading oanc_masc 回答1: To download a particular dataset/models, use the nltk.download() function, e.g. if you are looking to download the punkt sentence

Python Multiprocessing error: AttributeError: module '__main__' has no attribute '__spec__'

北城以北 提交于 2019-11-27 02:38:30
问题 I'm using Python 3.6 and am trying to follow along with the very first example at the website below (full code also below) and am getting the below error: https://docs.python.org/3.6/library/multiprocessing.html Error message: AttributeError: module '__main__' has no attribute '__spec__' Full example code: from multiprocessing import Pool def f(x): return x*x if __name__ == '__main__': with Pool(5) as p: print(p.map(f, [1, 2, 3])) I tried Googling it and searching Stack Overflow but I've only

How to change python version in anaconda spyder

瘦欲@ 提交于 2019-11-27 01:26:56
I am using 3.6 Python version in anaconda spyder on my mac. But I want to change it to Python 2.7. Can any one tell me how to do that? You can open the preferences (multiple options): keyboard shortcut Ctrl + Alt + Shift + P Tools -> Preferences And depending on the Spyder version you can change the interpreter in the Python interpreter section (Spyder 3.x): or in the advanced Console section (Spyder 2.x): If you want to keep python 3, you can follow these directions to create a python 2.7 environment, called py27. Then you just need to activate py27: $ conda activate py27 Then you can install