Using Zeus with Python Pandas

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 Pandas

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 and these modules include everything need to get started using pandas.

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

Code: Select all

import pandas as pd  
import numpy as np
import matplotlib.pyplot as plt

np.random.seed(0)

# array of normally distributed random numbers
values = np.random.randn(100) 

# generate a pandas series
s = pd.Series(values) 

# hist computes distribution
s.plot(kind='hist', title='Normally distributed random values') 
plt.show()
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 display the following graph window:
numpy-dist.png
numpy-dist.png (33.59 KiB) Viewed 23341 times
3. 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.

4. 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 (127.1 KiB) Viewed 23340 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