Python Pandas DataFrame

A DataFrame is a 2-dimensional array of columnar data.

The type is fully specified as pandas.core.frame.DataFrame.


Example


Data Model

DType

A column without significant consistency of data types will initialize with a dtype of object. Alternatives include:


Attrbibutes

Method

Meaning

axes

list containing the values of the index and columns attributed

columns

Index listing the column names

dtypes

Series listing the dtype of each column

iloc

indexable accessor of member values

index

RangeIndex containing the member indices

loc

indexable accessor of member values

shape

tuple of 2 ints representing number of rows and columns

size

int count of member values

values

nested numpy.ndarray containing the member values


Methods

These methods return numpy.float64 values unless otherwise specified.

Method

Meaning

Example

head

return a new DataFrame of the first N rows

df.head(5)

info

print information including types and null values

squeeze

return a Series view of the frame

sum

return a Series of sums for each row or column

df.sum(axis="columns"); df.sum(axis="index")

tail

return a new DataFrame of the last N rows

df.tail(5)


CategoryRicottone

Python/Pandas/DataFrame (last edited 2024-01-16 03:46:59 by DominicRicottone)