Implementation of Python in Easy Analytics

# Implementation of Python in Easy Analytics

Table of content

## Accessing Python

Python scripts can be run by clicking the 'Add data' button on the 'Data Management' page and selecting 'Run Python script'.

They can also be run from the Python console.

To open the Python console, click 'File', 'Options' and 'Show Python console' or press Alt+P.

In the console you can enter commands much like you do in an interactive Python session or in Idle. All output from scripts that you run will also be output to this window.

In the 'Python scripts' window you can add Python scripts by right clicking and selecting 'Add Script' or by draging and dropping scripts in the window. Scripts can then be executed by double clicking them.

## Included Python software

Easy Analytics comes with a complete version of Python 3.5.0 including all standard libraries.

If you want to install Python separately on your computer it is recommended that you install the same version (can be downloaded here) for the same platform (x86 or x86-x64) as your Easy Analytics. If Easy Analytics title bar says '32-bit' you need the x86 version, otherwise the x86-x64 version.

## Python functionality overview

The functionality that Easy Analytics makes available to Python covers:

- Reading supported file formats.
- Creating filters.
- Export data to SIMCA.
- Creating plots.
- Generating reports.
- Open/save projects.

The Python functionality is organized like this:

- umetrics package - The root package for all Easy Analytics functionality.
  - impdata package - Contains functionality for creating/reading and formatting data that can be imported as datasets in a project.
    - ImportData class - Used to hold data that can be imported as a dataset to a project.
    - open_file_dialog() method - Opens a file open dialog that lets you select file(s) to read. Has support for all file formats that SIMCA can read.
    - read_file() method - Reads file(s) in one of the supported file formats and returns it as an ImportData object.
  - UmetricsException class - The exception class used by all functionality in the umetrics package.
  - umetrics.plot package
    - set_template_file method - Sets the template file when creating new plots.
  - umetrics.easy_analytics package - functionality for manipulating projects.
    - MainDataset class - Interface to the main dataset
    - add_data_item(...) method - Adds a data item to the available data items.
    - clear_project(...) method - Removes all data from the current project.
    - create_plot(...) method - Creates a plot.
    - delete_data_item(...) method - Removes a dataitem from the available data items.
    - generate_report(...) method - Generates a report.
    - get_data_item(...) method - Returns the data items data.
    - get_deviation_analysis(...) method - Returns a deviation analysis matrix
    - get_main_dataset(...) method - Returns the main dataset (aggregate).
    - get_variable(...) method - Returns variable specific settings.
    - number_of_data_items(...) method - Returns the number of data items.
    - open_project(...) method - Opens a project.
    - save_project(...) method - Saves the current project.
    - save_report(...) method - Saves the current report as HTML or PDF.
    - start_simca(...) method - Starts SIMCA if it is installed.

Copyright© Sartorius Stedim Data Analytics AB
SIMCA, part of the Umetrics® Suite of Data Analytics Solutions
SIMCA® Multivariate Data Analytics Solution