Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
527 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'].sum()
samsung = df_stock[df_stock['item_lowercase'] == 'samsung galaxy a30 32gb']['count'].sum()
df_stock = df_stock.drop_duplicates(subset=['item_lowercase'], drop=Truej, reset_index())
#df_stock = df_stock.drop_duplicates(subset=['item_lowercase'], drop=reset_index())
print(df_stock.head())# write your code here
Leave a Comment