DataFrame class
A representation of a frame (table) of data.
Constructors
-
DataFrame({required Map<
String, NumericColumn> numericColumns, required Map<String, CategoricColumn> categoricColumns, bool ignoreLengthMismatch = false}) -
DataFrame.fromCsv(String text, {String separator = ",", String quote = '"', Map<
String, ColumnType> ? types}) -
A data frame built from a csv string.
factory
-
DataFrame.fromJsonAsListOfMaps(String jsonString, {Map<
String, ColumnType> ? types}) -
A data frame built from a json string representation of a list of maps.
factory
-
DataFrame.fromJsonAsMapOfLists(String jsonString, {Map<
String, ColumnType> ? types}) -
A data frame built from a json string representation of a map of lists.
factory
-
DataFrame.fromListOfMaps(List<
Map< data, {Map<String, Object> >String, ColumnType> ? types}) -
A data frame built from a list of maps.
factory
-
DataFrame.fromMapOfLists(Map<
String, List< data, {Map<Object> >String, ColumnType> ? types}) -
A data frame built from a map of lists.
factory
Properties
-
categoricColumns
→ Map<
String, CategoricColumn> -
The columns in this data frame containing categorical data.
final
-
columnNames
→ List<
String> -
A copy of the names of the columns in this data frame.
no setter
- columnNumber → int
-
The number of columns.
no setter
- copy → DataFrame
-
A copy of this data frame.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
numericColumns
→ Map<
String, NumericColumn> -
The columns in this data frame containing numeric data.
final
- rowNumber → int
-
The umber of rows.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
summary
→ Map<
String, Map< String, num> > -
A statistical summary of each column in this data frame.
no setter
Methods
-
groupedByCategory(
String name) → Map< String, DataFrame> - A map associating each category with a pure data frame.
-
groupedByNumeric(
String name) → Map< num, DataFrame> - A map associating each value with a pure data frame.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCsv(
{String separator = ",", Iterable< String> ? columns, Map<String, int> fixedPlaces = const {}}) → String - A conversion of this data frame to a csv representation.
-
toHtml(
{Iterable< String> ? columns, Map<String, int> fixedPlaces = const {}}) → String - A conversion of this data frame to an html table.
-
toJsonAsListOfMaps(
{Map< String, int> fixedPlaces = const {}}) → String - A conversion of this data frame to a json list of maps string.
-
toJsonAsMapOfLists(
{Map< String, int> fixedPlaces = const {}}) → String - A conversion of this data frame to a json map of lists string.
-
toListOfMaps(
{Map< String, int> fixedPlaces = const {}}) → List<Map< String, String> > - A conversion of this data frame to a list of maps.
-
toMapOfLists(
{Map< String, int> fixedPlaces = const {}}) → Map<String, List< String> > - A conversion of this data frame to a map of lists.
-
toMarkdown(
{Map< String, MarkdownAlignment> alignment = const {}, Iterable<String> ? columns, Map<String, int> fixed = const {}}) → String - A conversion of this data frame to a markdown table.
-
toString(
) → String -
A string representation of this object.
override
-
withCategoric(
{required String name, required CategoricColumn column, bool ignoreLengthMismatch = false}) → DataFrame - A new data frame with a categoric column added.
-
withCategoricColumnEnumerated(
String name) → DataFrame - A new data frame with numeric columns added to identify each category.
-
withCategoricColumnFromFormula(
{required String name, required String formula, required String generator(num)}) → DataFrame - A new data frame with a categoric column generated from a formula.
-
withCategoricColumnFromRowValues(
{required String name, required String generator(Map< String, num> numericValues, Map<String, String> categoricValues)}) → DataFrame - A new data frame with a categoric column generated based on row values.
-
withCategoricColumnFromTemplate(
{required String name, required String template, String startQuote = '{', String endQuote = '}', String generator(String)?}) → DataFrame - A new data frame with a categoric column generated from a template.
-
withColumnNamesChanged(
Map< String, String> changes) → DataFrame - A new data frame with the column names changed.
-
withColumns(
Iterable< String> columnNames) → DataFrame - A new data frame with only the selected columns.
-
withColumnsDropped(
Iterable< String> columnNames) → DataFrame - A new data frame without the selected columns.
-
withColumnsWhere(
bool predicate(String)) → DataFrame - A new data frame with only the columns whose names meet predicate.
-
withFullJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing a full join on
that
. -
withHead(
[int n = 10]) → DataFrame -
A new data frame with only the first
n
rows. -
withInnerJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing an inner join on
that
. -
withLeftJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing a left join on
that
. -
withLeftOuterJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing a left outer join on
that
. -
withMissingValues(
[Iterable< String> ? columns]) → DataFrame - A new data frame comprising the rows with at least one missing value.
-
withMissingValuesDropped(
[Iterable< String> ? columns]) → DataFrame - A new data frame comprising the rows without any missing values.
-
withNumeric(
{required String name, required NumericColumn column, bool ignoreLengthMismatch = false}) → DataFrame - A new data frame with a numeric column added.
-
withNumericColumnBinned(
String name, {List< (num, num)> bins = const [], int decimalPlaces = 3}) → DataFrame - A new data frame with a categoric column containing bins for values.
-
withNumericColumnFromFormula(
{required String name, required String formula}) → DataFrame - A new data frame with a column calculated from a formula.
-
withNumericColumnFromRowValues(
{required String name, required num generator(Map< String, num> numericValues, Map<String, String> categoricValues)}) → DataFrame - A new data frame with a numeric column calculated from row values.
-
withNumericColumnFromTemplate(
{required String name, required String template, required num generator(String), String startQuote = '{', String endQuote = '}'}) → DataFrame - A new data frame with a numeric column generated from a template.
-
withOuterJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing an outer join on
that
. -
withRightJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing a right join on
that
. -
withRightOuterJoinOn(
DataFrame that, {required String pivot, String? thatPivot}) → DataFrame -
A new data frame representing a right outer join on
that
. -
withRowsAdded(
DataFrame that) → DataFrame -
A new data frame with the rows of
that
added. -
withRowsAtIndices(
Iterable< int> indices) → DataFrame -
A new data frame comprising the rows at
indices
. -
withRowsOrderedBy(
List< String> columns, {bool decreasing = false}) → DataFrame -
A new data frame with the rows ordered by the values in
columns
. -
withRowsSampled(
int n, {bool withReplacement = false, int? seed}) → DataFrame - A new data frame comprising sampled rows.
-
withRowsWhereFormula(
{required String formula, required bool predicate(num)}) → DataFrame - A new data frame with rows selected based on a formula's results.
-
withRowsWhereTemplate(
{required String template, required bool predicate(String), String startQuote = '{', String endQuote = '}'}) → DataFrame - A new data frame with the rows that meet a predicate based on a template.
-
withTail(
[int n = 10]) → DataFrame -
A new data frame with only the last
n
rows.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → Column< Comparable, Comparable>