DF_fromArray
DataFrame *DF_fromArray(double *data, int numRows, char *name);
Creates a DataFrame with one feature from the given array.
info
Added in version 0.0.0
Parameters
double* data← Pointer to the source array.int numRows← Number of rows/samples in the source array.char* name← Name of the column/feature.
Return
DataFrame*→ Pointer to the newly created DataFrame.
note
- Caller is responsible for freeing allocated memory.
see also
DF_free()to free the DataFrame.
Example
#include <ml-in-c/datatypes/dataframe.h>
int main() {
// Create a DataFrame from an array
double data[] = {1, 2, 3};
DataFrame *df = DF_fromArray(data, 3, "feature1");
return 0;
}