Pandas Series

From NovaOrdis Knowledge Base
Revision as of 17:35, 8 October 2023 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

External

Internal

Overview

A series is a one-dimensional array of values, where each value has a label. The labels are referred to as "axis labels" and they are managed by the series's index. By default, in absence of any explicit specification, a series gets a monotonic integer range index, starting with 0 and with the step 1.

Data stored in series can be

Index

https://pandas.pydata.org/docs/reference/api/pandas.Series.index.html
https://pandas.pydata.org/docs/reference/indexing.html

RangeIndex

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

Create a Series

A series can be created from an in-memory list:

import pandas as pd

a = ['a', 'b', 'c']
s = pd.Series(a)

A series can also be created from data stored externally.

To create a series from a CSV file:

import pandas as pd

# TODO

Accessing Elements of a Series

This is known as indexing or subset selection.

Operations on Series

Filtering

Transformation

This class of operations are referred to as transformations or conversions.

Binary Operations