text_html_output_1.png
import pandas as pd

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

import pandas as pd
items = {'Bob': pd.Series(data=[245, 25, 55], index=['bike', 'pants', 'watch']), 'Alice': pd.Series(data=[40, 110, 500, 45], index=['book', 'glasses', 'bike', 'pants'])}

shopping_carts = pd.DataFrame(items)
shopping_carts

data = {'Bob': pd.Series([245, 25, 55]), 'Alice': pd.Series([40, 110, 500, 45])}
df = pd.DataFrame(data)
df

bob_shopping_cart = pd.DataFrame(items, columns=['Bob'])
bob_shopping_cart

sel_shopping_cart = pd.DataFrame(items, index=['pants', 'book'])
sel_shopping_cart

alice_sel_shopping_cart = pd.DataFrame(items, index=['glasses', 'bike'], columns=['Alice'])
alice_sel_shopping_cart

data = {'Integers': [1, 2, 3], 'Floats': [4.5, 8.2, 9.6]}
df = pd.DataFrame(data)
df

items = [{'bikes': 15, 'pants': 20, 'watches': 35}, {'bikes': 12, 'pants': 30, 'watches': 40, 'glass': 10}]
store_items = pd.DataFrame(items, index=['store 1', 'store 2'])
store_items

print()
print('How many bikes are in each store:\n', store_items[['bikes']])
print()
print('How many bikes and pants are in each store:\n', store_items[['bikes', 'pants']])
print()
print('What items are in Store 1:\n', store_items.loc[['store 1']])
print()
print('How many bikes are in Store 2:', store_items['bikes']['store 2'])