spyder

Install Deap for Python (Spyder)

跟風遠走 提交于 2019-12-13 09:47:09
问题 How should I install deap package for python from spyder? I have tried: pip install deal import deap deap.download() 回答1: Assuming deap is not installed, type: pip install deap If you get the response Collecting deap Installing collected packages: deap Successfully installed deap-1.0.2 Then you have just installed deap and you are ready to import it into your projects. If you get the response, Requirement already satisfied (use --upgrade to upgrade): deap in ./Path/To/site-packages , deap is

Python. ValueError could not convert string to float:

不打扰是莪最后的温柔 提交于 2019-12-13 08:24:39
问题 I'm trying to produce the average of numbers in a specified column in a text file. I am receiving an error that python could not convert string to float, although I don't see where I could be passing it an invalid string. def avg_col(f, col, delim=None, nhr=0): """ file, int, str, int -> float Produces average of data stored in column col of file f Requires: file has nhr header rows of data; data is separated by delim >>> test_file = StringIO('0.0, 3.5, 2.0, 5.8, 2.1') >>> avg_col(test_file,

Very Simple Program Crashing Python 3.5 and spyder

心不动则不痛 提交于 2019-12-13 07:07:43
问题 xx = 0 n = 4294967295 while xx <= n: print("xx = ", xx, bin(xx)) xx += 1 This results in the following traceback: File "<ipython-input-2-0c9d04ddbbc6>", line 1, in <module> runfile('C:/Users/Allen/Documents/Python Scripts/crunchy.py', wdir='C:/Users/Allen/Documents/Python Scripts') File "C:\Users\Allen\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile execfile(filename, namespace) File "C:\Users\Allen\Anaconda3\lib\site-packages\spyderlib

Is it possible to open a ljpg (lossless jpeg) file in Python?

纵然是瞬间 提交于 2019-12-13 06:44:32
问题 Does anyone know if it is possible to open a ljpg (lossless jpeg) file in Python? (specifically I'm using spyder on Windows XP). I've searched around on Google, here and the Python documentation and I can't see anything. If it's not possible, I'll try to work out how to call Octave to convert it, but it would be great if I didn't have to do that. Thanks! 回答1: Since the below didn't work, try this wrapper: http://ebiznisz.hu/python-jpegtran/ Appears to do the trick. http://www.pyglet.org/doc

Running a pyqt application twice from one prompt in spyder

给你一囗甜甜゛ 提交于 2019-12-13 04:37:49
问题 I run a pyqt4 application in spyder , I exit with QtGui.QMainWindow.close() and it returns me to the spyder python interpreter prompt. However, if I try and run the application again runfile('C:/Python33/~/qtapp.py', wdir=r'C:/Python33/~/Appdir') The window doesn't show. I have to shut the python interpreter window down and open a new one up before I can run my pyqt4 app again. This suggest to me that I am. Not shutting down the app correctly Not running the app correctly I want to be able to

python spyder IDE 3.14 ( python 3.6) kernel restarts while running in debug mode

落花浮王杯 提交于 2019-12-13 03:48:26
问题 It looks like spyder IDE is pretty limited when it comes to debugging any scipy ML code as it is not possible to run scipy optimization methods or plotting libraries in debug mode. The kernel keeps on restarting . I am not sure how to debug my code particularly the scipy.optimize.minimize method( i don't want to go inside the method to debug but just want to execute it in a loop of 10 and read the parameter theta). I can do it easily in Octave. I am surprised that spyder python IDE lacks

IPython (Spyder) is very slow and often freezes running on Mac OS X 10.11

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 02:39:22
问题 I've just changed from MATLAB to Python and I'm rather disappointed. I've installed Spyder 2.3 for Python 2.7 via terminal on my early '15 MBP (just for you to get an idea about the hardware) with OS X El Capitan installed on it and the IPython console it is pretty slow. Running simple commands like numpy's np.arange() or sometimes even while calculating fundamental things just as 1+1 , it takes between several seconds and a minute and sometimes it even freezes for a couple of minutes. Since

Launching Spyder and JupyterNotebook causes importError when image not found

独自空忆成欢 提交于 2019-12-13 02:24:55
问题 I'm new to python and the virtual environment stuff. I'm facing issues opening jupyter notebook and Spyder after updating conda. Here are some info about the versions I have: $ conda info active environment : None '''is it caused by this ? ''' user config file : /Users/-/.condarc populated config files : /Users/-/.condarc conda version : 4.5.4 conda-build version : 3.0.27 python version : 2.7.14.final.0 base environment : /Users/-/anaconda2 (writable) channel URLs : https://repo.anaconda.com

Libraries work fine in Spyder but not in PyCharm

梦想与她 提交于 2019-12-13 02:13:17
问题 I have a couple libraries that run fine in Spyder but not in PyCharm. import seaborn as sns import matplotlib.pyplot as plt In PyCharm, I thought I could click File > Settings and point the Project Interpreter to Python 3.6, which is what I'm using for Spyder, and that works fine. Is there some other setting that needs to be re-pointed? Or, is there something else that I'm missing? Finally, if I ned a new library, I go to the 'Anaconda Prompt' and 'pip install ...' the necessary library. Will

Directly open Spyder or open it through Pythonxy?

给你一囗甜甜゛ 提交于 2019-12-12 21:15:30
问题 Previously, I have been running Python in Spyder . I always started Spyder by directly double clicking its icon. Today, I suddenly realize that I have another thing called Python(x,y) . I notice that I can also start Spyder through it. Do these two methods make any difference? If not, what is the meaning of Python(x,y) ? Does it have any other good features? 回答1: Python(x,y) Python(x,y) is a scientific Python distribution . This means that it not only installs Python in your system but also