Questions tagged [danfojs]

Danfo.js is an open-source, JavaScript library providing high-performance, intuitive, and easy-to-use data structures for manipulating and processing structured data.

Webpage: https://danfo.jsdata.org/

28 questions
9
votes
1 answer

similar to pandas.resample but in node.js [danfo.js]

I am new to node.js and I am looking for a way to mimick the output of pandas.resample(‘3H’, label=’right’, closed=’left’).max() working with timeseries, being able to obtain a dataframe-like structure with the maximum value that happened in blocks…
5
votes
1 answer

How to iterate over a danfojs DataFrame

Is it possible to iterate a danfojs DataFrame? Thought maybe could use the .iloc function with an index, but .iloc returns a DataFrame, not a Series.
index49
  • 51
  • 1
4
votes
1 answer

How to import NPM package in vue 3 (Danfo.js)

This seems like a novice question and yet I don't understand it. How do I import and use a third party js library in vue 3? In this case I'm trying to use Danfo.js https://danfo.jsdata.org/getting-started by doing npm install danfojs (even though it…
Jordan
  • 391
  • 5
  • 17
3
votes
1 answer

How to import and use Tensorflow's DANFO.js library inside an Angular web app?

I am trying to use Tensorflow's DANFO.js library inside an Angular web app (with Ionic component's but that is irelevant). I simply ran the command: npm install danfojs --save and npm install @tensorflow/tfjs-node --save I tried all kinds of…
Jakub Szlaur
  • 1,852
  • 10
  • 39
2
votes
0 answers

Group by month Danfo.js

My goal is to translate a line of code written in python's pandas to Danfo.js. The python code is the following: ftest_raw_money_per_month = ftest_raw.groupby(ftest_raw['trans_date'].dt.strftime('%Y-%m'))['tran_amount'].sum().sort_index() Where the…
Diego Orellana
  • 994
  • 1
  • 9
  • 20
2
votes
1 answer

Can't use danfo-js library in my google script

I wanted to find some library which is similar to pandas in Python and use it in my google script. I've found danfo-js https://github.com/opensource9ja/danfojs And using this guide https://blog.gsmart.in/es6-and-npm-modules-in-google-apps-script/…
kozjava
  • 47
  • 6
1
vote
0 answers

How to reduce tensorflow-js dependency size while using danfojs-node

DanfoJS provides two versions danfojs-node (for NodeJS) danfojs ( browser side) DanfoJS depends on tensorflow-js. While installing danfoJS-node for a server side NodeJS application, we observe tensorflow-js dependency of danfojs-node takes around…
Sairam Krish
  • 10,158
  • 3
  • 55
  • 67
1
vote
1 answer

Javascrpt ; reshape a dataset (read in as a 2D array) to be indexed by rows instead of columns

I'm trying to format my dataset so it can be used by danfjo.js which is formatted as the following json_data = [{ A: 0.4612, B: 4.28283, C: -1.509, D: -1.1352 }, { A: 0.5112, B: -0.22863, C: -3.39059, D: 1.1632 }, { A:…
1
vote
1 answer

Is there a way in Danfo.js to change the value of a single cell?

I understood Danfo.js is the Javascript equivalent to Pandas. Now I have a Danfo dataframe and want to change the cell at row i and column "name". In pandas I would use df.at(i,'name') = new_value However with Danfo I get cannot assign to function…
Philip Z.
  • 206
  • 2
  • 6
1
vote
1 answer

How can I obtain the column values of a DataFrame in Danfojs?

I am using the package Danfojs in React. I have a dataframe where I'd like to obtain the values of a column as an array. If I try with df.values, I get an array of arrays, where each array is a row not a column. This is my code, note that I'm also…
chococroqueta
  • 694
  • 1
  • 6
  • 18
1
vote
3 answers

Danfo.js : read .tsv files with readCSV() / read_csv()?

in node.js environment with Danfo.js, reading .csv files is very easy with readCSV(), formerly read_csv(), as shown in the official example: const dfd = require("danfojs-node") dfd.readCSV("file:///home/Desktop/user_names.csv") .then(df => { …
taiyodayo
  • 331
  • 4
  • 13
1
vote
2 answers

Danfo dataFrame - Replace values by index, column

In Panda DataFrames in python, replacing values by column and index is very straight-forward. Example DataFrame: df = pd.DataFrame({'A': [1, 2, 3], 'B': [200, 300, 400]}) A B 0 1 200 1 2 300 2 3 400 Replacing values is as simple…
1
vote
2 answers

Is there any function available in Danfo.js similar to pandas isin()

I am working extensive data processing in nodejs. I found danfojs as a nice alternative to python Pandas. But facing some functionality lacking in comparison to Pandas. How to work out pandas isin() functionality in Danfojs ? Example: I have the…
Shamim
  • 635
  • 2
  • 12
  • 28
1
vote
1 answer

Could not feed my convolution1d with csv data

I need a help for my following problem. I'm trying to feed my csv data to my first layer which is convolution1d but it shows Input 0 is incompatible with layer conv1d_Conv1D1: expected ndim=3, found ndim=2 Here is my code //move the…
1
vote
0 answers

How to normalize a histogram with Danfo.js?

I need to get normalized histogram. So in Danfo notebooks I tried syntax like this: s = new dfd.Series([1, 3, 2, 2, 2, 6, 10, 10, 34, 40, 51, 90, 90, 90, 90, 1, 3, 2, 2, 2, 6, 10, 10, 34, 40, 51, 90, 90, 90, 90, 1, 3, 2, 2, 2, 6, 10, 10, 34, 40, 51,…
1
2