All Projects → hosseinmoein → Dataframe

hosseinmoein / Dataframe

Licence: bsd-3-clause
C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types, continuous memory storage, and no pointers are involved

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Dataframe

Quantitative Notebooks
Educational notebooks on quantitative finance, algorithmic trading, financial modelling and investment strategy
Stars: ✭ 356 (-57%)
Mutual labels:  data-science, data-analysis, trading-strategies, trading-algorithms
Tablesaw
Java dataframe and visualization library
Stars: ✭ 2,785 (+236.35%)
Mutual labels:  dataframe, data-science, data-analysis, statistical-analysis
Datasheets
Read data from, write data to, and modify the formatting of Google Sheets
Stars: ✭ 593 (-28.38%)
Mutual labels:  dataframe, data-science, pandas
Eland
Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
Stars: ✭ 235 (-71.62%)
Mutual labels:  dataframe, data-analysis, pandas
Data Science Hacks
Data Science Hacks consists of tips, tricks to help you become a better data scientist. Data science hacks are for all - beginner to advanced. Data science hacks consist of python, jupyter notebook, pandas hacks and so on.
Stars: ✭ 273 (-67.03%)
Mutual labels:  data-science, data-analysis, pandas
Pdpipe
Easy pipelines for pandas DataFrames.
Stars: ✭ 590 (-28.74%)
Mutual labels:  dataframe, data-science, pandas
Alphapy
Automated Machine Learning [AutoML] with Python, scikit-learn, Keras, XGBoost, LightGBM, and CatBoost
Stars: ✭ 564 (-31.88%)
Mutual labels:  data-science, pandas, trading-strategies
Dominando-Pandas
Este repositório está destinado ao processo de aprendizagem da biblioteca Pandas.
Stars: ✭ 22 (-97.34%)
Mutual labels:  pandas, data-analysis, dataframe
Boltzmannclean
Fill missing values in Pandas DataFrames using Restricted Boltzmann Machines
Stars: ✭ 23 (-97.22%)
Mutual labels:  dataframe, data-science, pandas
Pandasvault
Advanced Pandas Vault — Utilities, Functions and Snippets (by @firmai).
Stars: ✭ 316 (-61.84%)
Mutual labels:  dataframe, data-science, pandas
Pandas Summary
An extension to pandas dataframes describe function.
Stars: ✭ 361 (-56.4%)
Mutual labels:  data-science, data-analysis, pandas
Morpheus Core
The foundational library of the Morpheus data science framework
Stars: ✭ 203 (-75.48%)
Mutual labels:  dataframe, data-analysis, statistical-analysis
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.
Stars: ✭ 1,304 (+57.49%)
Mutual labels:  dataframe, data-science, pandas
Pandas Ta
Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators
Stars: ✭ 962 (+16.18%)
Mutual labels:  dataframe, pandas, trading-algorithms
Pandastable
Table analysis in Tkinter using pandas DataFrames.
Stars: ✭ 376 (-54.59%)
Mutual labels:  dataframe, data-analysis, pandas
Koalas
Koalas: pandas API on Apache Spark
Stars: ✭ 3,044 (+267.63%)
Mutual labels:  dataframe, data-science, pandas
Deepgraph
Analyze Data with Pandas-based Networks. Documentation:
Stars: ✭ 232 (-71.98%)
Mutual labels:  data-science, data-analysis, pandas
Foxcross
AsyncIO serving for data science models
Stars: ✭ 18 (-97.83%)
Mutual labels:  dataframe, data-science, pandas
Ai Learn
人工智能学习路线图,整理近200个实战案例与项目,免费提供配套教材,零基础入门,就业实战!包括:Python,数学,机器学习,数据分析,深度学习,计算机视觉,自然语言处理,PyTorch tensorflow machine-learning,deep-learning data-analysis data-mining mathematics data-science artificial-intelligence python tensorflow tensorflow2 caffe keras pytorch algorithm numpy pandas matplotlib seaborn nlp cv等热门领域
Stars: ✭ 4,387 (+429.83%)
Mutual labels:  data-science, data-analysis, pandas
Prettypandas
A Pandas Styler class for making beautiful tables
Stars: ✭ 376 (-54.59%)
Mutual labels:  data-science, data-analysis, pandas

Build status Build Status
GitHub GitHub tag (latest by date)
C++17 Codacy Badge Binder

drawing

DataFrame

This is a C++ statistical library that provides an interface similar to Pandas package in Python.
A DataFrame can have one index column and many data columns of any built-in or user-defined type.
You could slice the data in many different ways. You could join, merge, group-by the data. You could run various statistical, summarization and ML algorithms on the data. You could add your custom algorithms easily. You could multi-column sort, custom pick and delete the data. And more …
DataFrame also includes a large collection of analytical routines in form of visitors -- see documentation below. These are from basic stats such as Mean, Std Deviation, Return, … to more involved analysis such as Affinity Propagation, Polynomial Fit, Hurst Exponent, … -- See documentation for a complete list with code samples, and how you can add your custom algorithms.

I have followed a few principles in this library:

  1. Support any type either built-in or user defined without needing new code
  2. Never chase pointers ala linked lists, std::any, pointer to base, ..., including virtual function calls
  3. Have all column data in continuous memory space. Also, be mindful of cache-line aliasing misses between multiple columns
  4. Never use more space than you need ala unions, std::variant, ...
  5. Avoid copying data as much as possible
  6. Use multi-threading but only when it makes sense
  7. Do not attempt to protect the user against garbage in, garbage out

Views
You can slice the data frame and instead of getting another data frame you can opt to get a view. A view is a data frame that is a reference to a slice of the original data frame. So if you change the data in the view the corresponding data in the original data frame will also be changed (and vice versa).

Multithreading

  1. DataFrame uses static containers to achieve type heterogeneity. By default, these static containers are unprotected. This is done by design. So by default, there is no locking overhead. If you use DataFrame in a multithreaded program you must provide a SpinLock defined in ThreadGranularity.h file. DataFrame will use your SpinLock to protect the containers.
    Please see documentation, set_lock(), remove_lock(), and dataframe_tester.cc for code example.
  2. In addition, instances of DataFrame are not multithreaded safe either. In other words, a single instance of DataFrame must not be used in multiple threads without protection, unless it is used as read-only.
  3. In the meantime, DataFrame utilizes multithreading in two different ways internally:
    1. Async Interface: There are asynchronous versions of some methods. For example, you have sort()/sort_async(), visit()/visit_async(), ... more. The latter versions return a std::future that could execute in parallel.
    2. DataFrame uses multiple threads, internally and unbeknown to the user, in some of its algorithms when appropriate. User can control (or turn off) the multithreading by calling set_thread_level() which sets the max number of threads to be used. The default is 0. The optimal number of threads is a function of users hardware/software environment and usually obtained by trail and error. set_thread_level() and threading level in general is a static property and once set, it applies to all instances.

DateTime
DateTime class included in this library is a very cool and handy object to manipulate date/time with nanosecond precision.


DataFrame Documentation / Code Samples

DateTime Documentation


DataFrame Test File
DataFrame Test File 2
Heterogeneous Vectors Test File
Date/Time Test File


Contributions
License


Installing using CMake

mkdir [Debug | Release]
cd [Debug | Release]
cmake -DCMAKE_BUILD_TYPE=[Debug | Release] ..
make
make install

cd [Debug | Release]
make uninstall

Package managers

If you are using Conan to manage your dependencies, add dataframe/[email protected] to your requires, where x.y.z is the release version you want to use. Conan will acquire DataFrame, build it from source in your computer, and provide CMake integration support for your projects. See the conan docs for more information.
Sample conanfile.txt:

[requires]
dataframe/[email protected]

[generators]
cmake

Performance

There is a test program dataframe_performance that should give you some sense of how this library performs. As a comparison, there is also a Pandas Python pandas_performance script that does exactly the same thing.
dataframe_performance.cc uses DataFrame async interface and is compiled with gcc compiler with -O3 flag.
pandas_performance.py is ran with Pandas 1.1.0 and Python 3.7.
I ran both on my mac-book, doing the following:
drawing

  1. Generate ~1.6 billion second resolution timestamps and load it into the DataFrame/Pandas as index.
  2. Generate ~1.6 billion random numbers each for 3 columns with normal, log normal, and exponential distributions and load them into the DataFrame/Pandas.
  3. Calculate the mean of each of the 3 columns.

Result:

MacBook> time python test/pandas_performance.py
All memory allocations are done. Calculating means ...

real  17m18.916s
user  4m47.113s
sys   5m31.901s


MacBook> time bin/Linux.GCC64/dataframe_performance
All memory allocations are done. Calculating means ...

real  5m25.641s
user  2m37.362s
sys   2m3.451s

The interesting part:

  1. Pandas script, I believe, is entirely implemented in Numpy which is in C.
  2. In case of Pandas, allocating memory + random number generation takes almost the same amount of time as calculating means.
  3. In case of DataFrame 90% of the time is spent in allocating memory + random number generation.
  4. You load data once, but calculate statistics many times. So DataFrame, in general, is about 17x faster than parts of Pandas that are implemented in Numpy. I leave parts of Pandas that are purely in Python to imagination.
  5. Pandas process image at its peak is ~105GB. C++ DataFrame process image at its peak is ~68GB.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].