spyder

Python: calculate the most and the least active customers

邮差的信 提交于 2019-12-08 06:21:13
问题 I have a question on how to find the most and the least active customers. We were given a group of different names. For example "sam, sam, luke, luke, luke" We are asked to find the most frequent name and the least frequent name using python(spyder). These results need to be reflected in a box in wxFormBuilder . I am not sure what exactly I should do. Here is what I have so far for looking for the most active customer: def mostactive(self,parent): for name in range (self.m_listBox1.GetCount()

What is Outline Explorer in Spyder?

百般思念 提交于 2019-12-08 05:02:55
问题 I see it referenced, but never explained what it is. https://docs.spyder-ide.org/editor.html Googled without success. https://docs.spyder-ide.org/editor.html "Providing a description to the right of the separator will give that cell its own name in the Outline Explorer." Sounds like something for Navigating cells? Where do I find it? Are there shortcuts for navigating cells you create? Thanks! 回答1: in your code you can use this , for examle in spyder before each function ( above line of each

Spyder Python Animation not working

拥有回忆 提交于 2019-12-08 04:34:06
问题 I'm working on a python project using spyder from anaconda and I am trying to get the animation function working. I found a basic animation example here: http://matplotlib.org/1.4.1/examples/animation/basic_example.html and tried to make it work. However when I run it, nothing happens both in the Python and iPython console. I found this answer: Animation from matplotlib not working in spyder However, changing the preferences does not do anything and typing in %matplotlib qt returns: No module

Why can I call a function before defining it, with only a warning?

元气小坏坏 提交于 2019-12-08 03:36:55
问题 In other languages I often do something like this: someFunc() someFunc() { // This is my function } This way I can stack all my functions lower in the file, but make the function calls at the top. Now I have a nice overview of everything that's happening. However, when I did this in Python 3 in Spyder, I got the warning that Undefined name: 'myfunc' my_func("Some string") def my_func(some_var): print(some_var) The code works fine, but I'm not sure what best practice here. Are there any

Why is Spyder so slow in OS X? Is there a way to make it faster?

不问归期 提交于 2019-12-07 17:14:16
问题 I have Spyder installed as part of the Anaconda Python analytics package and I'm finding the editor to be very slow. There's always a half-second lag time between key presses and the letter showing up on screen. I'm using Spyder on a fairly new i7 MacBook. 回答1: This problem is generated by Qt, the graphical library Spyder is built upon. Not only Spyder but all applications that use Qt have shown this problem. A detailed explanation of the problem can be found here where we are also trying to

Import OpenCV under anaconda fails

人盡茶涼 提交于 2019-12-07 16:57:52
问题 I'm trying to use OpenCV under Anaconda for Python2.7.8.final.0. I did a fresh install of Anaconda, followed by import of the latest (win-64) distribution of OpenCV (2.4.9.1-np19py27_0) using the conda tool...all that seemed to work, the new libraries show up from >conda list. Everything is in the default locations. I ran the launcher, updated and then started spyder, and get the following: From the IPython console prompt: In [1]: import cv Traceback (most recent call last): File "", line 1,

data hiding for python QTconsole

孤街浪徒 提交于 2019-12-07 16:23:34
问题 Currently I am making an image authentication project in which I need to authenticate an image with the help of a key. I am taking the key as a raw_input from the user through the IPython console. I want to hide the key being entered. Expected Result: Enter the key = ***** or Enter the key = (nothing shown) I found getpass() method for hiding the entered data but it gives the following warning on my PC: Warning: QtConsole does not support password mode, the text you type will be visible. I

Add path to sys.path vs. PEP E402

不问归期 提交于 2019-12-07 16:19:54
问题 In order to import a project specific module somewhere located on your disk, one can easily append this directory to sys.path: import sys sys.path.append(some_module_path) import some_module However, the latter import now violates PEP E402 ("module level import not at top of file"). At least spyder tells me so. Is spyder here too picky? In spyder there is the principal idea of a "project", where I assumed environments can be adjusted specific for this project. However, I have no clue, how to

importing module in Spyder error

◇◆丶佛笑我妖孽 提交于 2019-12-07 12:06:56
问题 I am trying to use sklearn in Spyder. At the beginning when I tried to import it I was gettingImportError: No module named sklearn Then I tied to set the PATH with PYTHONPATH manager and then use 'Update module names list' from tools menu.then restart the spydet but no success. at the end I copied the sklearn folder to /Applications/Spyder.app/Contents/Resources/lib/python2.7 This is how I find the PATH of sklearn and copied in into this folder : >>> import sklearn >>> sklearn <module

spyder unicode decode error in startup

a 夏天 提交于 2019-12-07 00:37:30
I was using spyder-ide while parsing a tumblr page with the permission of the author, and at some point everything just crashed. Even my linux system had freezed. Well, to cut to the chase now I can not start spyder, it gives me the following error after I had written spyder to my terminal: Traceback (most recent call last): File "/home/dk/anaconda3/bin/spyder", line 2, in <module> from spyderlib import start_app File "/home/dk/anaconda3/lib/python3.5/site-packages/spyderlib/start_app.py", line 13, in <module> from spyderlib.config import CONF File "/home/dk/anaconda3/lib/python3.5/site