Skip to main content

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* dataPointer to the source array.
  • int numRowsNumber of rows/samples in the source array.
  • char* nameName of the column/feature.

Return

  • DataFrame* Pointer to the newly created DataFrame.
note
  • Caller is responsible for freeing allocated memory.
see also

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;
}