Input and Output

NEXTorch can read data from CSV or Excel files. It can output the same format.

IO functions that interfaces with CSV or Excel are built on pandas. The data are first read in as pandas.DataFrame. They are then converted to numpy.ndarray, passed to Experiment classes and used for plotting.

Examples

Specify the X and Y variable names in X_names and Y_names as Python lists. Read the data from a CSV file.

from nextorch import io

var_names = X_names + Y_names
data, data_full = read_csv(file_path, var_names = var_names)
X_real, Y_real, _, _ = io.split_X_y(data, Y_names = Y_names)

Convert the output data from a numpy.ndarray to a pandas.DataFrame and then export it to a CSV file.

from nextorch import io

data = io.np_to_dataframe([X, Y], var_names)
data.to_csv('test_data.csv')

Here is a list of IO functions in nextorch.io module.

np_to_dataframe

Convert a list numpy matrices to a single dataframe

read_csv

Reads a csv file and returns the data in pandas Dataframe

read_excel

Reads an excel file and returns the data in pandas Dataframe

split_X_y

Splits the data into independent (X) and dependent (y) varibles