DataFrame class abstract

An in-memory storage to keep data in column-like manner with human readable headers with possibility to convert the data to pure numeric representation.

Constructors

DataFrame(Iterable<Iterable> data, {bool headerExists = true, Iterable<String> header = const [], String autoHeaderPrefix = defaultHeaderPrefix, Iterable<int> columns = const [], Iterable<String> columnNames = const []})
Creates a dataframe from the non-typed data that is represented as two-dimensional array, where each element is a row of table-like data. The first element of the two-dimensional array may be a header of a dataset:
factory
DataFrame.fromJson(Map<String, dynamic> json)
factory
DataFrame.fromMatrix(Matrix matrix, {Iterable<String> header = const [], String autoHeaderPrefix = defaultHeaderPrefix, Iterable<int> columns = const [], Iterable<int> discreteColumns = const [], Iterable<String> discreteColumnNames = const []})
Create a DataFrame instance from a instance of Matrix
factory
DataFrame.fromRawCsv(String rawContent, {String fieldDelimiter = defaultFieldDelimiter, String textDelimiter = defaultTextDelimiter, String? textEndDelimiter, String eol = '\n', bool headerExists = true, Iterable<String> header = const [], String autoHeaderPrefix = defaultHeaderPrefix, Iterable<int> columns = const [], Iterable<String> columnNames = const []})
Creates a dataframe instance from stringified csv rawContent.
factory
DataFrame.fromSeries(Iterable<Series> series)
Create a DataFrame instance from a collection of Series
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
Returns a collection of names of all series (like a table header)
no setter
rows Iterable<Iterable>
Returns a collection of all data item rows of the DataFrame's source data
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
series Iterable<Series>
Returns a lazy series (columns) collection of the DataFrame.
no setter
shape List<int>
Returns a list of two integers representing the shape of the dataframe: the first integer is a number of rows, the second integer - a number of columns
no setter

Methods

addSeries(Series series) DataFrame
Returns a dataframe with a new series added to the end of this dataframe's series collection
dropSeries({Iterable<int> indices, Iterable<String> names}) DataFrame
Returns a new DataFrame without specified series
map<T, R>(R mapper(T value)) DataFrame
Returns a new DataFrame with modified data according to the mapper function
mapSeries<T, R>(R mapper(T value), {int? index, String? name}) DataFrame
Returns a new DataFrame with a modified series according to the mapper function
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sampleFromRows(Iterable<int> indices) DataFrame
Returns a dataframe, sampled from rows that are obtained from the rows indices
sampleFromSeries({Iterable<int> indices, Iterable<String> names}) DataFrame
Returns a dataframe, sampled from series that are obtained from the series indices or series names.
saveAsJson(String fileName, {bool rewrite = false}) Future<File>
inherited
shuffle({int seed}) DataFrame
Returns a new DataFrame with shuffled rows of this DataFrame
toJson() Map<String, dynamic>
inherited
toMatrix([DType dtype]) → Matrix
Converts the DataFrame into Matrix.
toString({int maxRows = 10, int maxCols = 7}) String
Returns a nicely formatted string to inspect the data of the DataFrame as the example below shows
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object key) Series
Returns a specific Series by a key.