From c8f33e1e71e933a1583c45fdf93df1a9c11bcaa2 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Sat, 16 Dec 2023 17:30:17 +0100 Subject: [PATCH] Update README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- pandas/basics/README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pandas/basics/README.md b/pandas/basics/README.md index 2428476..19bb518 100644 --- a/pandas/basics/README.md +++ b/pandas/basics/README.md @@ -45,7 +45,7 @@ class pandas.Series(data=None, index=None, dtype=None, name=None, copy=None, fas > > Operations between Series (+, -, /, *, **) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes. -Examples: +Example 1: ```python import pandas as pd @@ -62,7 +62,7 @@ Output: 2 Sleep dtype: object ``` - +Example 2: ```python import numpy as np @@ -80,7 +80,7 @@ Output: 2 32 dtype: int64 ``` - +Example 3: ```python import numpy as np @@ -104,6 +104,8 @@ Output: dtype: float64 ``` +Example 4: + ```python import pandas as pd @@ -120,3 +122,22 @@ Output: dtype: object ``` +### index and values + +```python +import pandas as pd + +example = pd.Series(["Bambu", "Tree", "Sleep"]) +print(example.index) +print() +print(example.values) +``` + +Output: + +```python +RangeIndex(start=0, stop=3, step=1) + +['Bambu' 'Tree' 'Sleep'] +``` +