Series class abstract

A named sequence of values that can be used as a column for the DataFrame.

name A series name

data A collection of dynamically typed data

isDiscrete Whether the data is discrete or not. If isDiscrete is true, unique values from the data will be extracted and saved to discreteValues field

Discrete values are elements from a finite set of values. Examples of discrete values:

  • Blood group. Possible values are A, B, AB and O

  • Size. Possible values are XS, S, M, L, XL

Usage examples:

  • A series with discrete values
import 'package:ml_dataframe/ml_dataframe';

void main() {
  final series = Series('super_series', [1, 4, 3, 1, 4, 3], isDiscrete: true);

  print(series);
  // super_series: [1, 4, 3, 1, 4, 3]

  print(series.discreteValues);
  // [1, 4, 3]
}
  • A series with continuous values
import 'package:ml_dataframe/ml_dataframe';

void main() {
  final series = Series('super_series', [1, 14, 3.4, 10, 'some_string', 111, false]);

  print(series);
  // super_series: [1, 14, 3.4, 10, 'some_string', 111, false]

  print(series.discreteValues);
  // []
}

Constructors

Series(String name, Iterable data, {bool isDiscrete})
factory
Series.fromJson(Map<String, dynamic> json)
Creates a Series instance from a json-serializable Series representation
factory

Properties

data Iterable
Returns a lazy iterable of Series instance data
no setter
discreteValues Iterable
Returns a lazy iterable of the data's unique values if a Series instance marked as isDiscrete. If isDiscrete is false, an empty list will be returned
no setter
hashCode int
The hash code for this object.
no setterinherited
isDiscrete bool
Returns true if a Series instance contains just discrete values instead of continuous ones
no setter
name String
A name of a Series instance
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a json-serializable representation of a Series instance
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited