These are chat archives for spyder-ide/public

17th
Dec 2018
anubhavgupta1
@anubhavgupta1
Dec 17 2018 12:47
hello
anybody is there . .. . ?
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 16:51
Hey, can we help you with Spyder?
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:11
hi, where can i find examples for spyder? i'd love to see some demos and how things are done
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:21
Hey, you can read our documentation for an explanation of our major features and the basics of how to use them although we're still in the process of expanding them, and there are a number of third-party video tutorials on learning the basics, though given Spyder's rapid pace of development, many might have some out of date information. We'd want to make a video demo/tutorial series of our own, but right now we're focusing our efforts on finishing Spyder 4, which will have numerous new features the community has been requesting.
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:27
ty. but no examples?
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:28
Could you clarify what sort of examples you're thinking of?
To my understanding "examples" as a concept aren't often discussed in the context of a GUI IDE, since what you do with it is dictated by a combination of its core features, which are explained in the documentation, and what you use it for, which is dictated by the code you write and the packages you choose. The closest thing to an "example" I can think of for an IDE would be tutorials on how to accomplish common tasks, of which I linked some to you.
If you mean screenshots, I had some screenshot examples of different Spyder pane layouts showing the wide variety of functionality available with Spyder like what Jupyter has in their tutorial, but @ccordoba12 removed them from the documentation for some reason.
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:33

i did find some here: https://github.com/qdonnellan/spyder-examples

it's just nice when mathematical cad environments give examples. like when i use mathematica it comes with a bunch of examples that i can learn from

they have lots of demos that make it all seem so wonderful
maybe one day people will share more of such so people can generate cad documents together for all types of subjects
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:36
Ah, well the key thing here is that unlike MATLAB and Mathematica, which are both an IDE and a proprietary language, Spyder itself is just the IDE, not the language (which is Python/the PyData stack).
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:37
yeah. but it's what seem to be a window to bind so much cool stuff together
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:37
You can find a nearly infinite variety of examples using Matplotlib and the PyData stack to make beautiful output, all of which will work great in Spyder, as well as other Python environments with the right dependencies.
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:38
great, ty
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:39
You can look at some stuff using Seaborn too
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:39
nice
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:40
The great thing with Spyder is that you can use any package for data analysis processing and output that uses the standard mechanisms, and similarly you can use them outside of Spyder as well; you aren't tied to a proprietary environment.
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:40
sure
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 18:41
In response to user suggestions, we're actually planning on adding a "Viewer" pane to future versions of Spyder which will allow full interactive 3D visualization of your datasets using any number of existing tools like Bokeh.
If you're interested in symbolic mathematics ala Mathematica, Spyder has full built-in support for SymPy (just enable it in the preferences) and will generate "pretty" inline LaTeX-rendered output. You can see some SymPy examples here.
Kristoffer Bernssen
@krizoek
Dec 17 2018 18:50
it's great. might make spyder into the king of the hill
Eoin Healy
@ehealy97_twitter
Dec 17 2018 19:44
Hi,
I would like to use the SimpleImputer command in python but it says its unavailable
how do i resolve this
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 19:49
The SimpleImputer class you're referring to is presumably the one from Scikit-Learn (a third party package) not a builtin Python function, and likely needs to be imported first (e.g. something like from sklearn.preprocessing import SimpleImputer if memory serves. If you are not able to get it to import within Spyder, you likely have it installed in the incorrect environment (or not installed at all). Please read our Guide to Managing Python Packages and Environments in Spyder for more details about the Spyder-related aspects of the issue. Spyder 4 will include a built-in GUI for doing these sorts of tasks, to make the process even easier.
Eoin Healy
@ehealy97_twitter
Dec 17 2018 19:53
when i use that command it says "ImportError: cannot import name 'SimpleImputer'"
i have tried to update using pip an the following command:
conda install scikit-learn
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 19:57

"ImportError: cannot import name 'SimpleImputer'"

That means either the import command I gave is not the right one (it was just off the top of my head) or you don't have scikit learn installed in the environment you have active in Spyder. To determine which is the case, try import sklearn. If it doesn't work, read and follow the guide I posted above. If it does, then its not really a Spyder IDE issue and you just need to check the scikit-learn docs to find the correct thing to import, or just Google SimpleImputer and it should come right up.

I assume you're a beginner, so I suggest reading the Python documentation on modules and the import system as well as one of the many tutorials you can find online. Spyder also offers links to many resources in the Help menu, as well as on-demand help on any function, class, method, etc. in the Editor or Console by pressing putting your cursor over the name and pressing the Help shortcut (Ctrl-I by default).

update using pip

conda install scikit-learn

As you can see from the command, you "updated" (really, installed) with conda, not pip. That is the correct install command for scikit learn, so if you ran that command in the same environment you're launching Spyder from, it should work. You just need to import the correct thing.

Eoin Healy
@ehealy97_twitter
Dec 17 2018 20:04
i tried import sklearn and no errors appeared
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 20:06
Okay, then you just need to import from the correct module path, which doesn't really have anything to do with Spyder. I strongly encourage you to thoroughly read the tutorials and documentation I linked since the understanding therein will be vital for whatever you do with Python, Spyder-related or otherwise.
Eoin Healy
@ehealy97_twitter
Dec 17 2018 20:06
a friend of mine is using from 'sklearn.impute import SimpleImputer' and it is working for him but when I use that i get "ImportError: cannot import name 'is_scalar_nan'"
CAM Gerlach
@CAM-Gerlach
Dec 17 2018 20:15

That should be the correct import command, which you would have found in the first result if you had Googled SimpleImputer. Especially if you're a beginner, Google is your friend.

Your error again suggests some problem with your specific environment, either due to missing dependencies (numpy, scipy, etc), a problem with your scikit-learn installation (e.g. installing having two simultaneous installs, e.g. sklearn and scikit-learn or pip and conda, etc), having a file named something like sklearn or scikit-learn on your path, or something else to do with a package/environment problem. Any parts of that problem that are related to Spyder are discussed in the guide I linked, which I yet again ask you to read first, and if that does not resolve it and you are able to reproduce the problem outside of Spyder (e.g. by running that command in a jupyter qtconsole instance), then the problem certainly doesn't have anything to do with Spyder and I advise you go somewhere Scikit-Learn-related so you can get appropriate help with that. Thanks, and best of luck!