GithubHelp home page GithubHelp logo

bears's Introduction

Bears

Bears is a fast and simple alternative to Pandas.

Goals

  • Fast indexing

API

Create DataFrame

# with dict
DataFrame(data={'col1':arr1, 'col2':arr2})

# with keys/values
DataFrame(keys=['col1','col2'],values=[arr1,arr2])

Indexing

The recommended way for performance is to get records without column names. You can index a specific column with df.<column_name>.

df[5]     # [arr1[5], arr2[5]]
df[[1,3]] # DataFrame(data={'col1':arr1[[1,3]], 'col2':arr2[[1,3]]})
df[5:6]   # DataFrame(data={'col1':arr1[5:6], 'col2':arr2[5:6]})
scalar = df[5][df.col1]

df.rows_value()      # [arr1, arr2]
df.rows_value([1,2]) # [arr1[1,2], arr2[1,2]]

df.rows_dict()       # [ {'col1': arr1[0], 'col2': arr2[0]}, {'col1': arr1[1], 'col2': arr2[1]} ]
df.rows_dict([1])    # [ {'col1': arr1[1], 'col2': arr2[1]} ]

df.to_dict()        # {'col1': arr1, 'col2': arr2}
df.to_dict([1,3,5]) # {'col1': arr1[1,3,5], 'col2': arr2[1,3,5]}

bears's People

Contributors

elbaro avatar

Watchers

 avatar  avatar

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.