Giter VIP home page Giter VIP logo

dataframe's People

Contributors

nl253 avatar

Watchers

 avatar  avatar  avatar

Forkers

manu87ds

dataframe's Issues

Fix overloading of the `in` operator for this.rows

Currently there is a draft implementation of the overloading of the in operator but doesn't seem to work properly. I got it to work with a string dataframe but not numeric. You should be able to:

const hasRow = [1,2,3] in df;

You need to use the proxy that is already returned from the DataFrame.rows getter.

Add DataFrame tests

Don't re-implement tests for functionality that is forwarded to the Column. Test agg, call, matrix and other core methods in DataFrame.

Object.freeze what can be frozen

Some properties should never be assigned to. Research which ones can be made read-only and Object.freeze the object they are on.

Document dataset lookup

Currently it's not clear where these default datasets come from and how you can plug into this framework by changing a DataFrame.opts variable.

Generalise all conversion and export methods

df.toJSON, df.toHTML, df.toObj and df.toCSV have a lot in common. They all use the internal structure of the DataFrame object to convert it to something if no args are supplied. If an argument is supplied then it's treated as the file name of where the result of conversion can be saved. The task is to generalise all of these methods and make them partials of the new method.

Refactor Column tests

The tests for the Column class have been written quite a while ago and need to be looked at.

Refactor API into high level many-signature methods calling low-level, specific methods

Currently the API is clean in that there are very few methods with many if statements in them. However, if someone were to run them in a loop this would become costly. Ideally there would be a way to call selectByFunc instead of call select and check if isFunc(params[0]).

In essence:

class DataFrame {
  
  select(...params) {
    // choose select* depending on value of params
    // ...
  }

  selectByFunc(f) { ... }

  selectByIdx(n, m) { ... }

}

Add a row indexer object

So that:

df.row[0] === [df.cols[0][0], df.cols[1][0], ...]

This should be done by returning a Proxy which will allow to overload the indexing operator.

Custom ValidationError to control formatting

I would prefer to avoid having to do this and have the error constructor do it all:

throw new Error(msg('you need to provide pairs of colId, newName (e.g. df.rename(1, "Width", -2, "Length"))'))

Allow loading of archived data as DataFrame (gzip, zip, lzma etc.)

The constructor should accept filenames with the .zip, .gzip and .lzma and .7z extensions.

When the filename is passed to the constructor, the library should attempt to look for an existing (already un-archived) file and if it's not present, unarchive and place it in the same directory as the archive only without the archive extension. If it is present, then it's read as usual.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.