Skip to main content

I/O

Shapelets supports a variety of data sources to create Dataframe-like structures to process data.

To load or save data, you need to create a sandbox first just like shapelets-core

Read Data

1) Read from CSV files

You can read csv files using the from_csv() method. A basic example is:

from shapelets.apps import dataApp

# Create Data App
app = dataApp()

# Load data
csv_data = app.sandbox.form_csv(
rel_name="my_csv_data",
paths=["file.csv"]
)

This reader method has automatic delimiter/separator detection, so you do not need to specify the delimiter!

2) Read from parquet files

You can use from_parquet() to load parquet files.

A basic example here:

from shapelets.apps import dataApp

# Create Data App
app = dataApp()

# Load data
parquet_data = app.sandbox.form_parquet(
rel_name="my_parquet_data",
paths=["file.parquet"]
)

This function has more parameters, which you can find in the API Reference in shapelets-core

info

Want to learn more about our Data Engine? Check out shapelets-core documentation!