Is there a C / C ++ API for python pandas?

I am extracting bulk data from an old backend system using C / C ++ and porting it to Python using distutils . After retrieving the data in Python, I put it in a pandas DataFrame object to parse the data. Now I want to go faster and would like to avoid the second step.

Is there a C / C ++ API for pandas to create a DataFrame in C / C ++, add my C / C ++ data and pass it to Python? I am thinking of something that looks like a numpy C API.

I am already creating numpy array objects in C as a workaround, but I am heavily using time series data and would like to have TimeSeries and date_range objects.

+4
source share
3 answers

All pandas classes (TimeSeries, DataFrame, DatetimeIndex, etc.) have pure-Python definitions, so the C API does not exist. You might be better off passing numpy ndarrays from C to your Python code and letting your Python create pandas objects from them.

If necessary, you can use PyObject_CallFunction , etc. to call pandas constructors, but you will need to take care of accessing the names from the module import and check for errors.

+4
source

I am dealing with a similar problem loading data from a format not supported by Pandas with the C API. I found two ways to solve this problem, hope someone can find them useful.

+4
source

There is currently a C ++ library equivalent to the Pandas package in terms of interface and functionality. See This Linkedin Article " https://www.linkedin.com/pulse/pythons-pandas-c-update-hossein-moein/ " Open source is at " https://github.com/hosseinmoein/DataFrame "

0
source

All Articles