JavaScript: Manipulating data like Pandas using Danfo.js, replit ver. 1

Last Updated on June 24, 2022 by shibatau

I. What is Danfo.js

An open-source, JavaScript library providing high-performance, intuitive, and easy-to-use data structures for
manipulating and processing structured data. It is heavily inspired by the Python’s Pandas
library and provides a similar interface and API. Moreover, Danfo.js is fast and It is built on
Tensorflow.js and supports tensors out of the box.

Intoduction To Danfo.js – Manipulating And Processing Data

I have also learned the Danfo.js basics here:

https://danfo.jsdata.org/getting-started

II. The scripts

The sample data is here:

https://raw.githubusercontent.com/hirogami/data_englishJapanese/master/data/exam_englishJapanese

Load the data from URL: paste the following codes on the HTML file,

<!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.jsdelivr.net/npm/danfojs@1.1.0/lib/bundle.min.js"></script>
     <title>Document</title>
</head>

<body>

    <div id="plot_div"></div>
    <script>

  dfd.readCSV( "https://raw.githubusercontent.com/hirogami/data_englishJapanese/master/data/exam_englishJapanese"
   )
    .then(df => {

    //prints the first five columns
    df.head().print()

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

    </script>
</body>

</html>

If you use Replit, please paste the codes above on the index.html file and press the Run button. You will get the data frame on the bottom right corner like this:

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.