# Danfojs | A Powerful Javascript Data Analysis Toolkit

**URL:** <https://onehack.st/t/danfojs-a-powerful-javascript-data-analysis-toolkit/284879>\
**Category:** Tools & Scripts\
**Tags:** programming, streaming\
**Created:** [June 19, 2024, 7:03pm UTC](https://onehack.st/t/danfojs-a-powerful-javascript-data-analysis-toolkit/284879 "2024-06-19T19:03:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [June 19, 2024, 7:03pm UTC](https://onehack.st/t/danfojs-a-powerful-javascript-data-analysis-toolkit/284879/1 "2024-06-19T19:03:00Z")

</div>

[![](https://github.com/javascriptdata/danfojs/raw/dev/assets/logo.png)](https://github.com/javascriptdata/danfojs/blob/dev/assets/logo.png)

* * *

## Danfojs: powerful javascript data analysis toolkit

[![Node.js CI](https://github.com/opensource9ja/danfojs/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/opensource9ja/danfojs/workflows/Node.js%20CI/badge.svg?branch=master) [![](https://camo.githubusercontent.com/cd0c4fdd30ef75beba4ec205cee7f84d3b2f8ea3cbe8be44bcb24ae54654638b/68747470733a2f2f646174612e6a7364656c6976722e636f6d2f76312f7061636b6167652f6e706d2f64616e666f6a732f62616467653f7374796c653d726f756e646564)](https://www.jsdelivr.com/package/npm/danfojs) [![Coverage Status](https://camo.githubusercontent.com/ae9ce0ffefe9ab34c4c8fa9779ae88e9f83ec66e4b2bc155f42b09bec06fb1ce/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f70656e736f75726365396a612f64616e666f6a732f62616467652e737667)](https://coveralls.io/github/opensource9ja/danfojs) [![Twitter](https://camo.githubusercontent.com/c105a974150136f90f576dcbd8d188cdb9a0f5a49be38391b9290ce059c61df0/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c3f7374796c653d736f6369616c2675726c3d6874747073253341253246253246747769747465722e636f6d25324644616e666f4a73)](https://camo.githubusercontent.com/c105a974150136f90f576dcbd8d188cdb9a0f5a49be38391b9290ce059c61df0/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c3f7374796c653d736f6369616c2675726c3d6874747073253341253246253246747769747465722e636f6d25324644616e666f4a73) [![Patreon donate button](https://camo.githubusercontent.com/9c1ef25b7641dc719ef585713612a49d71e3d0279800cd82776bd51a0d076d37/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://www.patreon.com/bePatron?u=40496758)

## What is it?

**Danfo.js** is a javascript package that provides fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It is heavily inspired by [Pandas](https://pandas.pydata.org/pandas-docs/stable/) library, and provides a similar API. This means that users familiar with [Pandas](https://pandas.pydata.org/pandas-docs/stable/), can easily pick up danfo.js.

## Main Features

- Danfo.js is fast and supports Tensorflow.js tensors out of the box. This means you can [convert Danfo data structure](https://danfo.jsdata.org/api-reference/dataframe/dataframe.tensor) to Tensors.
- Easy handling of [missing-data](https://danfo.jsdata.org/getting-started#missing-data) (represented as `NaN`) in floating point as well as non-floating point data
- Size mutability: columns can be [inserted/deleted](https://danfo.jsdata.org/api-reference/dataframe#combining-comparing-joining-merging) from DataFrame
- Automatic and explicit [alignment](https://danfo.jsdata.org/api-reference/dataframe#reindexing-selection-label-manipulation): objects can be explicitly aligned to a set of labels, or the user can simply ignore the labels and let `Series`, `DataFrame`, etc. automatically align the data for you in computations
- Powerful, flexible [groupby](https://danfo.jsdata.org/api-reference/groupby) functionality to perform split-apply-combine operations on data sets, for both aggregating and transforming data
- Make it easy to convert Arrays, JSONs, List or Objects, Tensors and differently-indexed data structures into DataFrame objects
- Intelligent label-based [slicing](https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.loc), [fancy indexing](https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.iloc), and [querying](https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.query) of large data sets
- Intuitive [merging](https://danfo.jsdata.org/api-reference/general-functions/danfo.merge) and [joining](https://danfo.jsdata.org/api-reference/general-functions/danfo.concat) data sets
- Robust IO tools for loading data from [flat-files](https://danfo.jsdata.org/api-reference/input-output) (CSV, Json, Excel).
- Powerful, flexible and intutive API for [plotting](https://danfo.jsdata.org/api-reference/plotting) DataFrames and Series interactively.
- [Timeseries](https://danfo.jsdata.org/api-reference/series#accessors)-specific functionality: date range generation and date and time properties.
- Robust data preprocessing functions like [OneHotEncoders](https://danfo.jsdata.org/api-reference/general-functions/danfo.onehotencoder), [LabelEncoders](https://danfo.jsdata.org/api-reference/general-functions/danfo.labelencoder), and scalers like [StandardScaler](https://danfo.jsdata.org/api-reference/general-functions/danfo.standardscaler) and [MinMaxScaler](https://danfo.jsdata.org/api-reference/general-functions/danfo.minmaxscaler) are supported on DataFrame and Series

## Installation

There are three ways to install and use Danfo.js in your application

- For Nodejs applications, you can install the [**danfojs-node**](https://github.com/javascriptdata/danfojs/blob/dev) version via package managers like yarn and/or npm:

npm install danfojs-node or yarn add danfojs-node

For client-side applications built with frameworks like React, Vue, Next.js, etc, you can install the [**danfojs**](https://github.com/javascriptdata/danfojs/blob/dev) version:

npm install danfojs or yarn add danfojs

For use directly in HTML files, you can add the latest script tag from [JsDelivr](https://www.jsdelivr.com/package/npm/danfojs) to your HTML file:

See all available versions [here](https://www.jsdelivr.com/package/npm/danfojs)

### Quick Examples

- [Danfojs with HTML and vanilla JavaScript on CodePen](https://codepen.io/risingodegua/pen/bGpwyYW)
- [Danfojs with React on Code Sandbox](https://codesandbox.io/s/using-danfojs-in-react-dwpv54?file=/src/App.js)
- [Danfojs on ObservableHq](https://observablehq.com/@risingodegua/using-danfojs-on-observablehq)
- [Danfojs in Nodejs on Replit](https://replit.com/@RisingOdegua/Danfojs-in-Nodejs)

### Example Usage in the Browser
 Document 

 

 

## GitHub:

[https://github.com/javascriptdata/danfojs](https://github.com/javascriptdata/danfojs)
