Pandas Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 21: Line 21:
=Index=
=Index=
{{External|https://pandas.pydata.org/docs/reference/indexing.html}}
{{External|https://pandas.pydata.org/docs/reference/indexing.html}}
An index can be thought as individual elements labels, for a [[Pandas_Series#Series]] or as the row labels for a [[Pandas_DataFrame|DataFrame]].
==RangeIndex==
==RangeIndex==
<code>RangeIndex(start=0, stop=3, step=1)</code>
<code>RangeIndex(start=0, stop=3, step=1)</code>

Revision as of 02:46, 9 October 2023

Internal

Overview

pandas is a Python package that provides fast, flexible, and expressive data structures designed to make working with "relational" or "labeled" data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. Additionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language.

Pandas is built in top of Numpy.

DataFrame

DataFrame

Series

Series

Time Series Processing with Pandas

Time Series Processing with Panda

Axis

Both DataFrames and Series use the concept of axis. Formally define. By default, an axis comprises of monotonically increasing integers with step 1, from 0 to length - 1

Index

https://pandas.pydata.org/docs/reference/indexing.html

An index can be thought as individual elements labels, for a Pandas_Series#Series or as the row labels for a DataFrame.

RangeIndex

RangeIndex(start=0, stop=3, step=1)

DatetimeIndex

This is what makes a Series a time series. Merge with Time_Series_Processing_with_Pandas

DataFrame Index

DataFrame Index

Series Index

Series Index

Data Types

String

Datetime

TO PROCESS: https://pandas.pydata.org/docs/reference/api/pandas.Timestamp.html#pandas.Timestamp

Reported as datetime64[ns]. What is this?

Also see

Create a Time Series from CSV

Date format when represented as string: YYYY-MM-DD, "2023-10-01".

Visualization

Both the DataFrame and Series have a plot() method, which delegates to matplotlib.