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:
int64
float64
datetime64
bool
category
Attrbibutes
Method |
Meaning |
axes |
list containing the values of the index and columns attributed |
columns |
Index listing the column names |
dtypes |
|
iloc |
|
index |
RangeIndex containing the member indices |
loc |
|
shape |
|
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) |