Pandas DataFrame: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
=Internal=
=Internal=
* [[Pandas_Concepts#DataFrame|Pandas Concepts]]
* [[Pandas_Concepts#DataFrame|Pandas Concepts]]
* [[Panda_Series|Series]]
* [[Pandas_Series|Series]]


=Overview=
=Overview=
A DataFrame is a two-dimensional data structure with columns of potentially different types. The data structure also contains labeled axes, for both rows and columns.
A DataFrame is a two-dimensional data structure with columns of potentially different types. The data structure also contains labeled axes, for both rows and columns.


Can be thought of as a dict-like container for [[Panda_Series#Overview|Series]] objects, where each column is a [[Panda_Series#Overview|Series]]. The dimensionality of the DataFrame is given by its <code>[[#Shape|shape]]</code> property.
Can be thought of as a dict-like container for [[Pandas_Series#Overview|Series]] objects, where each column is a [[Pandas_Series#Overview|Series]]. The dimensionality of the DataFrame is given by its <code>[[#Shape|shape]]</code> property.


=Shape=
=Shape=

Revision as of 18:36, 8 October 2023

External

Internal

Overview

A DataFrame is a two-dimensional data structure with columns of potentially different types. The data structure also contains labeled axes, for both rows and columns.

Can be thought of as a dict-like container for Series objects, where each column is a Series. The dimensionality of the DataFrame is given by its shape property.

Shape

shape is a property of the DataFrame, containing a tuple that returns the dimensionality of the DataFrame: rows, columns.

Create a DataFrame

Create a DataFrame from a CSV File

Accessing Elements of a DataFrame

iloc[]

A property that allows integer-based access (indexing).

loc[]

A property that allows label-based access (indexing).

squeeze()

[]

Operations on DataFrames