From a numpy file#
Use this path for pre-computed feature arrays stored as .npy.
Expected shape: (n_samples, n_variables) or (n_variables, n_samples). The longer dimension is assumed to be n_samples.
Steps#
Tip
Install EthoGraph if you haven’t already, then launch via shortcut or:
conda activate ethograph && ethograph launch
In the I/O widget, click Create with own data — the wizard opens.
Under Single trial, select: 4) Generate from npy file
Click Next — the dialog opens
Set Npy file (
.npy)Set Data sampling rate (Hz)
Optionally set Video file — frame rate is auto-detected
Set Output path for the generated
session.ncClick Generate .nc file
The I/O widget auto-populates -> click Load
Dialog fields#
Field |
Notes |
|---|---|
Npy file |
2D array — shape |
Data sampling rate |
Hz |
Video file |
Optional |
Output path |
Adding named variables#
The dialog creates generic variable names (var_0, var_1, …). To give columns meaningful names, create the dataset via a short script instead:
import numpy as np
import xarray as xr
data = np.load("features.npy") # shape: (n_samples, n_vars)
sr = 1000.0
ds = xr.Dataset({
"emg": xr.DataArray(
data,
dims=["time", "channels"],
coords={
"time": np.arange(data.shape[0]) / sr,
"channels": ["biceps", "triceps"],
},
)
})
ds.to_netcdf("session.nc")
Data requirements#
Attribute |
Value |
|---|---|
|
Not required unless video is also loaded |
For the full xarray.Dataset structure see Data Format Requirements.