dart_pandas 0.2.2 copy "dart_pandas: ^0.2.2" to clipboard
dart_pandas: ^0.2.2 copied to clipboard

An analog of the pandas library in python

DartPandas #

DartPandas is a Dart library for working with tabular data, inspired by the famous pandas library from Python. It provides convenient tools for processing, analyzing, and visualizing data directly in your Dart applications. DartPandas is perfect for developers who want to use Dart for data analysis but don't want to sacrifice the convenience and power offered by pandas.


Key Features #

  • DataFrame: A two-dimensional table with named columns and rows.
  • Data Reading and Writing: Support for CSV, JSON files.
  • Filtering and Sorting: Filter data based on conditions and sort by values or index.
  • Aggregation and Statistics: Sum, mean, min, max, standard deviation, variance.
  • Grouping Data: Group data by specific columns and apply aggregation functions.
  • Text Processing: Basic text operations like uppercase, lowercase, and substring replacement.
  • Integration with Flutter: Easily visualize data using Flutter charts.

Installation #

Add dart_pandas to your pubspec.yaml file:

dependencies:
  dart_pandas: ^0.2.2

Then run:

flutter pub get

Usage #

Creating a DataFrame

import 'package:dart_pandas/dart_pandas.dart';

void main() {
  // Create a DataFrame
  final df = DataFrame({
    'name': ['Alice', 'Bob', 'Charlie'],
    'age': [25, 30, 35],
    'salary': [50000, 60000, 70000],
  });

  // Print the DataFrame
  df.printDataFrame();
}

Filtering Data

final filteredDf = df.filter((row) => row['age'] > 30);
filteredDf.printDataFrame();

Sorting Data

final sortedDf = df.sort('salary', ascending: false);
sortedDf.printDataFrame();

Aggregating Data

final averageSalary = df.mean('salary');
print('Average Salary: $averageSalary');

Grouping Data

final groupedDf = df.groupBy('department');
groupedDf.forEach((key, value) {
  print('Department: $key');
  value.printDataFrame();
});
3
likes
140
points
26
downloads

Publisher

verified publisheranykeylib.ru

Weekly Downloads

An analog of the pandas library in python

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

csv

More

Packages that depend on dart_pandas