Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataFrame (like in R or Pandas) for C++ [closed]

Tags:

Is there a C++ library providing a data structure similar to DataFrame from R or Pandas? What I'm mostly interested in is:

  • data structure for tabular data, columns can be of different types (float, integer, string,...),
  • operations like selecting, filtering, merging, combining, grouping, etc.
like image 706
piokuc Avatar asked Sep 30 '14 10:09

piokuc


People also ask

Is Panda like R?

In conclusion, we can say that R is a programming language whereas Pandas is a library. Using the packages of R, we can perform different operations where Pandas helps us to perform different operations. This tutorial will help beginners to understand the difference between the two and also help in migrating easily.

Can I use pandas in C?

pandas uses C extensions (mostly written using Cython) to speed up certain operations. To install pandas from source, you need to compile these C extensions, which means you need a C compiler. This process depends on which platform you're using.

What is the difference between DataFrame and pandas?

Pandas DataFrame is Mutable. Complex operations are difficult to perform as compared to Pandas DataFrame. Complex operations are easier to perform as compared to Spark DataFrame. Spark DataFrame is distributed and hence processing in the Spark DataFrame is faster for a large amount of data.

Is pandas query faster than LOC?

The query function seams more efficient than the loc function. DF2: 2K records x 6 columns. The loc function seams much more efficient than the query function.


2 Answers

You can also check out the xtensor C++ library which has an API very close to that of numpy, and also handles missing values.

Bonus point: you can use it to edit numpy arrays inplace. http://xtensor.readthedocs.io/en/latest/.

like image 146
Quant Avatar answered Sep 28 '22 13:09

Quant


I don't know a C++ library per se that can do what Pandas can do, but perhaps you might not want to use C++ for that. Have you considered using C++/Python bindings? These can facilitate easy transitions from C++ to Python so you can use Pandas dataframes and transition them to C++.

See, for example, Boost.Python: https://wiki.python.org/moin/boost.python?action=show&redirect=BoostPython

like image 38
so860 Avatar answered Sep 28 '22 13:09

so860