text_plain_output_1.png
import pandas as pd

groceries = pd.Series(data=[20, 6, 'Yes', 'No'], index=['eggs', 'apples', 'milk', 'bread'])
groceries

fruits = pd.Series(data=[10, 6, 3], index=['apples', 'oranges', 'bananas'])
fruits

print('Original grocery list of fruits:\n ', fruits)
print()
print('Amount of bananas + 2 = ', fruits['bananas'] + 2)
print()
print('Amount of apples - 2 = ', fruits.iloc[0] - 2)
print()
print('We double the amount of apples and oranges:\n', fruits[['apples', 'oranges']] * 2)
print()
print('We half the amount of apples and oranges:\n', fruits.loc[['apples', 'oranges']] / 2)