Danfo.js
  • Danfo.js Documentation
  • Getting Started
  • API reference
    • General Functions
      • danfo.tensorflow
      • danfo. convertFunctionTotransformer
      • danfo.streamCsvTransformer
      • danfo.streamJSON
      • danfo.streamCSV
      • danfo.Utils
      • danfo.Str
      • danfo.Dt
      • danfo.dateRange
      • danfo.OneHotEncoder
      • danfo.StandardScaler
      • danfo.MinMaxScaler
      • danfo.LabelEncoder
      • danfo.toDateTime
      • danfo.getDummies
      • danfo.concat
      • danfo.merge
    • Input/Output
      • danfo.readExcel
      • danfo.toExcel
      • danfo.readJSON
      • danfo.toJSON
      • danfo.readCSV
      • danfo.toCSV
    • Series
      • Creating a Series
      • Series.append
      • Series.cumSum
      • Series.cumMax
      • Series.cumProd
      • Series.cumMin
      • Series.str.split
      • Series.str.len
      • Series.str.join
      • Series.str.trim
      • Series.str.substring
      • Series.str.substr
      • Series.str.slice
      • Series.str.search
      • Series.str.repeat
      • Series.str.replace
      • Series.str.lastIndexOf
      • Series.str.indexOf
      • Series.str.includes
      • Series.str.endsWith
      • Series.str.startsWith
      • Series.str.concat
      • Series.str.charAt
      • Series.str.toUpperCase
      • Series.str.toLowerCase
      • Series.str.capitalize
      • Series.dt.seconds
      • Series.dt.minutes
      • Series.dt.dayOfMonth
      • Series.dt.monthName
      • Series.dt.hours
      • Series.dt.dayOfWeek
      • Series.dt.dayOfWeek
      • Series.dt.month
      • Series.dt.year
      • Series.argMax
      • Series.argMin
      • Series.argSort
      • Series.replace
      • Series.isNa
      • Series.fillNa
      • Series.dropNa
      • Series.dropDuplicates
      • Series.valueCounts
      • Series.nUnique
      • Series.unique
      • Series.abs
      • Series.ne
      • Series.eq
      • Series.ge
      • Series.le
      • Series.gt
      • Series.lt
      • Series.iloc
      • Series.loc
      • Series.at
      • Series.iat
      • Series.ndim
      • Series.shape
      • Series.dtype
      • Series.values
      • Series.tensor
      • Series.index
      • Series.apply
      • Series.map
      • Series.setIndex
      • Series.resetIndex
      • Series.describe
      • Series.copy
      • Series.sortValues
      • Series.var
      • Series.std
      • Series.round
      • Series.minimum
      • Series.maximum
      • Series.count
      • Series.sum
      • Series.max
      • Series.min
      • Series.mode
      • Series.median
      • Series.mean
      • Series.mod
      • Series.pow
      • Series.div
      • Series.mul
      • Series.sub
      • Series.add
      • Series.sample
      • Series.tail
      • Series.head
      • Series.and
      • Series.or
    • Dataframe
      • Creating a DataFrame
      • DataFrame.sortIndex
      • DataFrame.append
      • DataFrame.nUnique
      • DataFrame.tensor
      • DataFrame.print
      • DataFrame.toCSV
      • DataFrame.toJSON
      • DataFrame.toExcel
      • DataFrame.sortValues
      • DataFrame.setIndex
      • DataFrame.resetIndex
      • DataFrame.rename
      • DataFrame.drop
      • DataFrame.asType
      • DataFrame.shape
      • DataFrame.axis
      • DataFrame.ndim
      • DataFrame.values
      • DataFrame.selectDtypes
      • DataFrame.ctypes
      • DataFrame.index
      • DataFrame.loc
      • DataFrame.iloc
      • DataFrame.at
      • DataFrame.iat
      • DataFrame.head
      • DataFrame.tail
      • DataFrame.sample
      • DataFrame.add
      • DataFrame.sub
      • DataFrame.mul
      • DataFrame.div
      • DataFrame.pow
      • DataFrame.mod
      • DataFrame.mean
      • DataFrame.median
      • DataFrame.min
      • DataFrame.max
      • DataFrame.std
      • DataFrame.var
      • DataFrame.count
      • DataFrame.round
      • DataFrame.cumSum
      • DataFrame.cumMin
      • DataFrame.cumMax
      • DataFrame.cumProd
      • DataFrame.copy
      • DataFrame.describe
      • DataFrame.sum
      • DataFrame.abs
      • DataFrame.query
      • DataFrame.addColumn
      • DataFrame.groupby
      • DataFrame.column
      • DataFrame.fillNa
      • DataFrame.isNa
      • DataFrame.dropNa
      • DataFrame.apply
      • DataFrame.applyMap
      • DataFrame.It
      • DataFrame.gt
      • DataFrame.le
      • DataFrame.ge
      • DataFrame.ne
      • DataFrame.eq
      • DataFrame.replace
    • Configuration Options
    • Plotting
      • Timeseries Plots
      • Violin Plots
      • Box Plots
      • Tables
      • Pie Charts
      • Histograms
      • Scatter Plots
      • Bar Charts
      • Line Charts
      • Customizing your plots
    • Groupby
      • Groupby.getGroups
      • Groupby.col
      • Groupby.max
      • Groupby.min
      • Groupby.sum
      • Groupby.mean
      • Groupby.std
      • Groupby.var
      • Groupby.count
      • Groupby.cumSum
      • Groupby.cumMax
      • Groupby.cumMin
      • Groupby.cumProd
      • Groupby.agg
  • User Guides
    • Migrating to the stable version of Danfo.js
    • Using Danfojs in React
    • Titanic Survival Prediction using Danfo.js and Tensorflow.js
  • Building Data Driven Applications with Danfo.js - Book
  • Contributing Guide
  • Release Notes
Powered by GitBook
On this page
  • [LATEST] Release Node (v1.2.0), Browser (v1.2.0)
  • Release Node (v1.1.2), Browser (v1.1.2)
  • Release Node (v1.0.3), Browser (v1.0.3)
  • Release Node (v1.0.2), Browser (v1.0.2)
  • Release Node (v1.0.1), Browser (v1.0.1)
  • Release Node (v1.0.0), Browser (v1.0.0)
  • Release Node (v0.3.3), Browser (0.3.3)
  • Release - Node (v0.3.2), Browser (0.3.2)
  • Release - Node (v0.3.1), Browser (0.3.1)
  • [LATEST] ReleaseNode (v0.2.7), Browser (0.2.6)
  • ReleaseNode (v0.2.6), Browser (0.2.5)
  • Release Node (v0.2.5), Browser (0.2.4)
  • Release (v0.2.2)
  • Release (v0.1.5)
  • Release (v0.1.0-beta)

Was this helpful?

Release Notes

[LATEST] Release Node (v1.2.0), Browser (v1.2.0)

Date: 3rd April 2025

What's Changed

  • Upgrade of SheetJS dependency

  • fix: replace does not accept falsy strings or numbers

  • Adds function overload to NDFrame toCSV and toJSON so danfojs-base and danfojs-browser can use the same code

  • Better error handling for io functions

  • Update io.excel.ts to use default values for options

  • fix dtypes not used on csv parse

  • fix isEmpty bug with bigInt

Contributors: @risenW @BowTiedAztec @kgeis @geoextra @pensono @acctsi1 @babennettdev @kitfit-dave @ekynoxe @nucoinha @lyhue1991

Full Changelog: https://github.com/javascriptdata/danfojs/releases/tag/v1.2.0

Release Node (v1.1.2), Browser (v1.1.2)

Date: 12th October 2022

What's Changed

  • Fix copy/paste error in df.apply documentation by @kgeis in https://github.com/javascriptdata/danfojs/pull/469

  • Makes an ESM bundle using esbuild by @dcrescim in https://github.com/javascriptdata/danfojs/pull/447

  • Fix invalid assert.throws statements by @igonro in https://github.com/javascriptdata/danfojs/pull/419

  • Allow Series.append() to use zero, fixes #486 by @BowTiedAztec in https://github.com/javascriptdata/danfojs/pull/487

  • Add error handler for io functions by @risenW in https://github.com/javascriptdata/danfojs/pull/503

  • add support for excel parsing options arg by @risenW in https://github.com/javascriptdata/danfojs/pull/505

  • Chore/add default support for datetime by @risenW in https://github.com/javascriptdata/danfojs/pull/511

Contributors: @risenW @BowTiedAztec @kgeis

Full Changelog: https://github.com/javascriptdata/danfojs/compare/v1.1.1...v1.1.2

Release Node (v1.0.3), Browser (v1.0.3)

Date: 8th March 2022

What's Changed

  • add max to list of arithmetic operations by @steveoni in https://github.com/javascriptdata/danfojs/pull/367

  • correct lenght -> length by @adamgilman in https://github.com/javascriptdata/danfojs/pull/393

  • Bug fixes by @risenW in https://github.com/javascriptdata/danfojs/pull/395

  • Fix bug in groupby checking wrong colDtype by @igonro in https://github.com/javascriptdata/danfojs/pull/398

  • fix(test): Explicit type in test allows TS to compile by @NeonSpork in https://github.com/javascriptdata/danfojs/pull/411

  • Jan kaul esmodule by @risenW in https://github.com/javascriptdata/danfojs/pull/415

Contributors: @risenW @steveoni @adamgilman @igonro @NeonSpork

Full Changelog: https://github.com/javascriptdata/danfojs/compare/v1.0.2...v1.0.3

Release Node (v1.0.2), Browser (v1.0.2)

Date: 19th Jan 2022

What's Changed

  • Update TensorFlow version to fix M1 chip incompatibility by @risenW in https://github.com/javascriptdata/danfojs/pull/358

  • Add new feature iat and at by @risenW in https://github.com/javascriptdata/danfojs/pull/359

  • Fixed issue with sort by values by @risenW in https://github.com/javascriptdata/danfojs/pull/360

Full Changelog: https://github.com/javascriptdata/danfojs/compare/v1.0.1...v1.0.2

Release Node (v1.0.1), Browser (v1.0.1)

Date: 16th Jan 2022

Minor bug fixes

Release Node (v1.0.0), Browser (v1.0.0)

Date: 12th Jan 2022

New Features

  • Full Typescript support

  • streamCsvTransforme ==> Pipable stream transformer for incrementally transforming DataFrames

  • streamJSON ==> Supports streaming of local or remote JSON files into DataFrame.

  • streamCSV ==> Supports streaming of local or remote CSV files into DataFrame.

  • openCsvInputStream ==> Open a local/remote CSV file as a readable stream

  • writeCsvOutputStream ==> Open a local/remote CSV file as a writable stream

Bug Fixes

Release Node (v0.3.3), Browser (0.3.3)

Date: 10th Oct 2021

Minor patch update

Release - Node (v0.3.2), Browser (0.3.2)

Date: 2nd Oct 2021

Minor patch update for column name display after aggregation functions like sum, mean, var, are applied to a column axis.

Release - Node (v0.3.1), Browser (0.3.1)

Date: 1st Oct 2021

New Features

  • Ability to create empty frames

  • Flag for toggling between low/high memory mode

  • Inplace support for all mutating operations

  • Ability to set Configuration values on frame creation

  • Support boolean mask for subsetting with iloc and loc. E.g df.iloc({rows: df["count"].gt(5), columns: [0, 1]})

  • Update an existing column value via subsetting. E.g df["count"] = [1,3,4,5]

  • Add loc indexing support for Series

  • Add configuration support for formating DataFrame display in the console

  • New DataFrame applyMap function for element-wise apply function

  • and and or logical comparison support. E.gdf.loc({``rows: df['Salary_in_1000'].gte(100)).and(df['Age'].gt(60))``})

  • to_csv , to_json and to_excel functions now support saving to local disk in Node and downloadable in the browser. Also, supports config parameters for output.

  • read_json now supports config values for headers, authentication, separator, etc.

  • DataFrame query function now accepts boolean masks with single or multiple conditions. E.gdf.query({rows: df['Salary_in_1000'].gte(100)).and(df['Age'].gt(60))})

Bug Fixes

  • Column data not being updated when mutating internal data array

  • Str class error for non-string type

  • Better error message

  • Fix support for all JS Date format

  • Fix loc slicing bug for row index with string labels

  • DataFrame apply function now works only across a specified axis

[LATEST] ReleaseNode (v0.2.7), Browser (0.2.6)

Date: 30th May 2021

ReleaseNode (v0.2.6), Browser (0.2.5)

Date: 29th March 2021

group = df.groupby(['A"])
group.min()


groupby.apply((x) => x.add(2))
groupby.col(["C"]).apply((x) => x.min())

Contributors: @steveoni @PrawiraGenestonlia @woosuk288 @risenW

Release Node (v0.2.5), Browser (0.2.4)

Date: 6th March 2021

We added/updated the following features:

  • Fix error thrown when danfojs CDN is placed in an HTML header

  • Smaller bundle size for browser: From ~1.7mb to about ~550kb

  • Stopped bundling Danfojs with Plotly. This means that as of v0.2.3, we no longer ship with Plotly distribution due to the huge size. Plotly plots are still supported, but in order to make them, you have to explicitly add the Plotly CDN or package.

A simple example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.plot.ly/plotly-1.2.0.min.js"></script> 
    <script src="https://cdn.jsdelivr.net/npm/danfojs@1.2.0/lib/bundle.min.js"></script> 

    <title>Document</title>
</head>

<body>

    <div id="div1"></div>
    <div id="div2"></div>
    <div id="div3"></div>

    <script>

        dfd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
            .then(df => {

                df['AAPL.Open'].plot("div1").box() //makes a box plot

                df.plot("div2").table() //display csv as table

                new_df = df.set_index({ key: "Date" }) //resets the index to Date column
                new_df.plot("div3").line({ columns: ["AAPL.Open", "AAPL.High"] })  //makes a timeseries plot

            }).catch(err => {
                console.log(err);
            })

    </script>
  
</body>

</html>

Date: 14th February 2021

We added/updated the following features:

  • Fix babel runtime issue in node version

  • Smaller size in browser version in this version. From ~8mb to about ~5mb

  • Fix browser tag issue and returns back to specific versioning instead of @latest

  • Danfojs now ships with an exported version of tensorflowjs-node (2.8.5). This fixes the double dependency issue when building ML models, as you no longer need to install/import tensorflowjs separately.

To use tensoflowjs-node, you can reference it from danfo as shown below:

const dfd = require("danfojs-node")
const tf = dfd.tf //contains a reference to the tensorflowjs-node library

const model = tf.sequential();
model.add(tf.layers.dense({ inputShape: [7], units: 124, activation: 'relu', kernelInitializer: 'leCunNormal' }));
model.add(tf.layers.dense({ units: 64, activation: 'relu' }));
model.summary();

Release (v0.1.5)

Date: 25th September 2020

We added/updated the following features:

  • Fix null value bug when creating DataFrame from JSON files (Fix)

  • Add relative import for reading files into DataFrame

  • Minor patch and overall optimizations (Fix)

Release (v0.1.0-beta)

Date: 15th August 2020

This is a minor release for browser-based environments. We added/updated the following features:

  • Ability to create DataFrame/Series from Tensors

  • Add iloc function for Series

  • Fixed upper bound bug in indexing

Contributors: Rising Odegua, Stephen Oni

PreviousContributing Guide

Last updated 2 months ago

Was this helpful?

Contributors: @,

Major breaking update. See the migration for pre-v1 users.

Contributors

read_csv now uses and supports config values for headers, separator, etc.

read_excel now uses parser, hence supports all XLSX config options.

Contributors

[Bug Fixes]: [Patches]

Contributors and

[Bug Fixes]:

[Patches] ,

[Feature] Perform groupby operation on grouped columns directly:

Release

files from local and remote URL into DataFrame (New feature)

files from local or remote URL into DataFrame (New feature)

Fix string comparison bug in function (Fix)

Add append function for and (New feature)

Add function to DataFrame and Series (New feature)

Contributors: , , ,

Update function to accept Series

Add inplace option for

Fix bug in function of DataFrame

Add Inplace option for

https://github.com/javascriptdata/danfojs/issues/354
https://github.com/javascriptdata/danfojs/issues/344
https://github.com/javascriptdata/danfojs/pull/347
Devwulf
@risenW
guide
https://github.com/javascriptdata/danfojs/issues/325
https://github.com/javascriptdata/danfojs/issues/296
https://github.com/javascriptdata/danfojs/issues/335
https://github.com/javascriptdata/danfojs/issues/338
@risenW
@steveoni
Papaparse
XLSX
@risenW
#206
#203
#200
#198
#198
#188
#181
#175
#183
#168
#191
#161
#206
@risenW
@steveoni
@jpjagt
@sponsfreixes
@bherbruck
@woosuk288
@adithyaakrishna
#150
#152
#159
#158
#154
(v0.2.2)
Read JSON
Read Excel
query
DataFrame
Series
sort_index
Rising Odegua
Stephen Oni
Jhenner Tigreros
Aditya Zope
addColumns
fillna
rename
query