Using Zeus with Python Numpy, Matplotlib, Scipy and Seaborn

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Using Zeus with Python Numpy, Matplotlib, Scipy and Seaborn

Post by jussij »

1. Installation
Form inside the Zeus IDE, select the Tools, Language Shells Command Prompt menu and in the resulting screen run the following command:

Code: Select all

python -m pip install numpy scipy matplotlib
These commands will use pip to install the Python, numpy scipy and matplotlib components.

The results of that installation should result in the following output:
numpy-install.jpg
numpy-install.jpg (275.07 KiB) Viewed 23120 times
2. Checking the Installation
Save the following code to the numpy-test.py file:

Code: Select all

import numpy as np

arr = np.array([1, 2, 3, 4, 5])

print(arr)

print(type(arr))
Using the same tool window from the first step, use this command to run that code:

Code: Select all

python numpy-test.py
That command should produce the following output:

Code: Select all

[1 2 3 4 5]
<class 'numpy.ndarray'>
3. Graph Plotting Example
Using the same tool window from the first step, import the seaborn package using the following command:

Code: Select all

pip install seaborn
To test this installation save the following code to the numpy-plot.py file:

Code: Select all

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.chisquare(df=1, size=1000), hist=False)

plt.show()
Now use this command to run that code:

Code: Select all

python numpy-plot.py
That command should display the following graph window:
numpy-plot.png
numpy-plot.png (37.85 KiB) Viewed 23121 times
4. Using the Macros Menu to Execute the Python Script
The same result can be achieved by making the numpy-test.py file the active file and then using the Macro, Execute menu to run the file.

5. Autocomplete and Code Navigation
The Zeus IDE uses jedi for Python code navigation and autocompletion.

Here is an example of the auto completion:
numpy-complete.png
numpy-complete.png (139.82 KiB) Viewed 23115 times
The code navigation allows the user to navigate to the symbol under the cursor.

NOTE: The first time that the jedi is called it builds a cache of the imports which can take a few seconds, meaning the first autocomplete request will be slow. But subsequent request should work as expected.

Cheers Jussi
Post Reply