Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
580 B
3
Indexable
Never
import pandas as pd

df_stock = pd.read_csv('/datasets/phone_stock.csv')
df_stock['item_lowercase'] = df_stock['item'].str.lower()

apple = df_stock[df_stock['item_lowercase'] == 'apple iphone xr 64gb'].count()# finish this line of code
samsung = df_stock[df_stock['item_lowercase'] == 'samsung galaxy a30 32gb'].count()# finish this line of code

#apple = df_stock[df_stock['item'].str.contains('apple')].count()
#samsung = df_stock[df_stock['item'].str.contains('samsung')].count()

print("Total number of Apple phones:", apple)
print("Total number of Samsung phones:", samsung)
Leave a Comment