DataFrame.
from_records
Convert structured or record ndarray to DataFrame.
Field of array to use as the index, alternately a specific set of input labels to use
Columns or fields to exclude
Column names to use. If the passed data do not have names associated with them, this argument provides names for the columns. Otherwise this argument indicates the order of the columns in the result (any names not found in the data will become all-NA columns)
Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets
Number of rows to read if data is an iterator
Examples
Use dict as input
>>> ps.DataFrame.from_records({'A': [1, 2, 3]}) A 0 1 1 2 2 3
Use list of tuples as input
>>> ps.DataFrame.from_records([(1, 2), (3, 4)]) 0 1 0 1 2 1 3 4
Use NumPy array as input
>>> ps.DataFrame.from_records(np.eye(3)) 0 1 2 0 1.0 0.0 0.0 1 0.0 1.0 0.0 2 0.0 0.0 1.0