Before, there was larry and structured/record arrays in NumPy, but I wonder if they are used any more with any frequency given the rapid development of the pandas
package. Coming from R, I would always get stuck having to unpack the record arrays to modify values from multiple columns and reassign them back into the structure but I'm so glad that pandas
now allows this for its data frames. I wonder if there are any uses for which record arrays are still superior (does it have some useful methods that pandas
does not have)?
Python Pandas DataFrame is a heterogeneous two-dimensional object, that is, the data are of the same type within each column but it could be a different data type for each column and are implicitly or explicitly labelled with an index.
Pandas DataFrame is a 2D mutable data structure that can store heterogeneous data in tabular format (i.e. in the form of labelled rows and columns).
A DataFrame is a 2-dimensional data structure that can store data of different types (including characters, integers, floating point values, categorical data and more) in columns.
Pandas Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.).
Here's a good explanation and simple comparison between pandas and numpy record arrays - Normalize/Standardize a numpy recarray
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With