Pavan.DataAnalysis.NET
1.0.0
See the version list below for details.
dotnet add package Pavan.DataAnalysis.NET --version 1.0.0
NuGet\Install-Package Pavan.DataAnalysis.NET -Version 1.0.0
<PackageReference Include="Pavan.DataAnalysis.NET" Version="1.0.0" />
paket add Pavan.DataAnalysis.NET --version 1.0.0
#r "nuget: Pavan.DataAnalysis.NET, 1.0.0"
// Install Pavan.DataAnalysis.NET as a Cake Addin #addin nuget:?package=Pavan.DataAnalysis.NET&version=1.0.0 // Install Pavan.DataAnalysis.NET as a Cake Tool #tool nuget:?package=Pavan.DataAnalysis.NET&version=1.0.0
DataAnalysis.NET
DataAnalysis.NET is a powerful .NET library designed for efficient data analysis and manipulation. It provides a flexible DataFrame structure and a suite of tools for reading, writing, cleaning, and analyzing data, with a focus on Excel and CSV file formats.
Features
- DataFrame Structure: A versatile data structure for holding and manipulating tabular data.
- File I/O:
- Read and write CSV files
- Read and write Excel (.xlsx) files
- Data Cleaning:
- Replace NaN values with a specified value or column mean
- Drop rows with NaN values
- Filter rows based on custom predicates
- Data Analysis:
- Column-wise operations: Sum, Mean, Variance
- Create pivot tables with custom aggregation functions
- Performance: Utilizes SIMD (Single Instruction, Multiple Data) for efficient column summation
Installation
Install DataAnalysis.NET via NuGet Package Manager:
Install-Package DataAnalysis.NET
Or via .NET CLI:
dotnet add package DataAnalysis.NET
Quick Start
using DataAnalysis.NET;
// Read a CSV file
var df = ExcelReader.ReadCsv("data.csv");
// Clean the data
DataCleaner.ReplaceNaNsWithMean(df);
// Perform analysis
var columnMeans = DataFrameOperations.MeanColumns(df);
// Create a pivot table
var pivotTable = DataFrameOperations.CreatePivotTable(df, 0, 1, arr => arr.Average());
// Write results back to Excel
DataFrame.WriteXlsx("results.xlsx", pivotTable);
Key Components
DataFrame
The core data structure for holding tabular data. It supports:
- Adding rows
- Retrieving columns
- Getting column names
- Printing data to console
ExcelReader
Provides methods for reading and writing CSV files:
ReadCsv(string filePath)
: Read data from a CSV file into a DataFrameWriteCsv(string filePath, DataFrame df)
: Write a DataFrame to a CSV file
DataFrameOperations
Offers various data analysis operations:
SumColumns(DataFrame df)
: Calculate the sum of each columnMeanColumns(DataFrame df)
: Calculate the mean of each columnVarianceColumns(DataFrame df)
: Calculate the variance of each columnCreatePivotTable(DataFrame df, int groupByCol, int valueCol, Func<double[], double> aggregationFunc)
: Create a pivot table with custom aggregation
DataCleaner
Provides methods for cleaning and filtering data:
ReplaceNaNs(DataFrame df, double replacementValue)
: Replace NaN values with a specified valueDropNaNs(DataFrame df)
: Remove rows containing NaN valuesReplaceNaNsWithMean(DataFrame df)
: Replace NaN values with the column meanFilterRows(DataFrame df, Func<double[], bool> predicate)
: Filter rows based on a custom predicate
Excel Support
DataAnalysis.NET includes built-in support for Excel files:
DataFrame.ReadXlsx(string filePath)
: Read data from an Excel file into a DataFrameDataFrame.WriteXlsx(string filePath, DataFrame df)
: Write a DataFrame to an Excel file
Use Cases
- Financial Analysis: Process and analyze financial data from CSV or Excel files.
- Data Cleaning: Easily handle missing values and filter datasets.
- Statistical Analysis: Compute basic statistical measures like mean and variance.
- Data Aggregation: Create pivot tables for summarizing large datasets.
- Data Transformation: Filter and manipulate data using custom predicates.
Contributing
We welcome contributions! Please see our Contributing Guidelines for more details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Happy Data Analyzing with DataAnalysis.NET!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- EPPlus (>= 7.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.