官术网_书友最值得收藏!

Spyder

Spyder is an IDE unlike the Jupyter Notebook or the Jupyter QT Console. It integrates NumPy, SciPy, Matplotlib, and IPython. It is extensible with plugins, and it is included with Anaconda.

The following screenshot shows Spyder, an actual IDE intended for data analysis and scientific computing:

Spyder Python 3.6

On the right, you can go to File explorer to search for new files to load. Here, we want to open up iris_kmeans.py. This is a file that contains all the commands that we used before in the Jupyter QT Console. Notice on the right that the editor has a console; that is in fact the IPython console, which you saw as the Jupyter QT Console. We can run this entire file by clicking on the Run tab. It will run in the console, shown as follows:

The following screenshot will be the output:

Notice that at the end we see the result of the clustering that we saw before. We can type in commands interactively as well; for example, we can make our computer say Hello, world!.

In the editor, let's type in a new variable, let's say n = 5. Now let's run this file in the editor. Notice that n is a variable that the editor is aware of. Now let's make a change, say n = 6. Unless we were to actually run this file again, the console will be unaware of the change. So if I were to type n in the console again, nothing changes, and it's still 5. You would need to run this line in order to actually see a change.

We also have a variable explorer where we can see the values of variables and change them. For example, I can change the value of n from 6 to 10, shown as follows:

The following screenshot shows the output:

Then, when I go to the console and ask what n is, it will say 10:

n
10
  

That concludes our discussion of Spyder.

主站蜘蛛池模板: 勐海县| 九龙坡区| 枣强县| 佳木斯市| 甘孜| 达拉特旗| 周口市| 大英县| 泊头市| 虞城县| 洱源县| 轮台县| 赤峰市| 石城县| 上犹县| 龙泉市| 张家界市| 翼城县| 佳木斯市| 靖安县| 姜堰市| 桦甸市| 西青区| 忻城县| 平舆县| 吉安县| 库尔勒市| 大城县| 德庆县| 凌海市| 古蔺县| 宁远县| 宜都市| 藁城市| 南召县| 大化| 凤翔县| 江山市| 青神县| 晋城| 措美县|