ml_dataframe 1.6.0 copy "ml_dataframe: ^1.6.0" to clipboard
ml_dataframe: ^1.6.0 copied to clipboard

An in-memory untyped data storage with the possibility to query and modify it

example/main.dart

import 'package:ml_dataframe/ml_dataframe.dart';

void dataframeWithHeaderDemo() {
  final dataframe = DataFrame([
    ['Age', 'City', 'Blood Group', 'is_married'],
    [33, 'Larnaca', 'A', true],
    [17, 'Limassol', 'A', false],
    [29, 'Nicosia', 'B', false],
    [45, 'Larnaca', 'AB', true],
  ]);

  print('\nDataframe with the header row: ');
  print(dataframe);
}

void headlessDataframeDemo() {
  final dataframe = DataFrame([
    [33, 'Larnaca', 'A', true],
    [17, 'Limassol', 'A', false],
    [29, 'Nicosia', 'B', false],
    [45, 'Larnaca', 'AB', true],
  ], headerExists: false);

  print('\nHeadless dataframe: ');
  print(dataframe);
}

void headlessDataframeWithCustomPrefixDemo() {
  final dataframe = DataFrame([
    [33, 'Larnaca', 'A', true],
    [17, 'Limassol', 'A', false],
    [29, 'Nicosia', 'B', false],
    [45, 'Larnaca', 'AB', true],
  ], headerExists: false, autoHeaderPrefix: 'SERIES_');

  print('\nHeadless dataframe with custom prefix: ');
  print(dataframe);
}

void predefinedHeaderDataframeDemo() {
  final dataframe = DataFrame(
      [
        [33, 'Larnaca', 'A', true],
        [17, 'Limassol', 'A', false],
        [29, 'Nicosia', 'B', false],
        [45, 'Larnaca', 'AB', true],
      ],
      headerExists: false,
      header: ['AGE', 'TOWN', 'Blood', 'MARRIED']);

  print('\nDataframe with predefined header: ');
  print(dataframe);
}

void dataframeWithSpecificColumnsDemo() {
  final dataframe = DataFrame([
    ['Age', 'City', 'Blood Group', 'is_married'],
    [33, 'Larnaca', 'A', true],
    [17, 'Limassol', 'A', false],
    [29, 'Nicosia', 'B', false],
    [45, 'Larnaca', 'AB', true],
  ], columnNames: [
    'Age',
    'is_married'
  ]);

  print('\nDataframe with specific columns: ');
  print(dataframe);
}

void main() {
  dataframeWithHeaderDemo();
  headlessDataframeDemo();
  headlessDataframeWithCustomPrefixDemo();
  predefinedHeaderDataframeDemo();
  dataframeWithSpecificColumnsDemo();
}
16
likes
115
pub points
81%
popularity

Publisher

verified publisherml-algo.com

An in-memory untyped data storage with the possibility to query and modify it

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

csv, json_annotation, ml_linalg, quiver

More

Packages that depend on ml_dataframe