import pandas as pd
data={'product':['product_A','product_B','product_C','product_D'],
'quantity':[10,20,30,40],
'sales':[100,200,300,400],
'store':['store1','store2','store3''store4'],
'customer':['customer1','customer2','customer3','customer4']}
data = pd.DataFrame(data)
print(data)
product_sold=data[data['quantity']>0] ['product'].unique()
print(product_sold)
quantity_sold=data.groupby(['product'])['quantity'].sum().reset_index()
print(quantity_sold)
quantity_sale_data.groupby(['product']).agg({'quantity': 'sum', 'sales': 'sum'}).reset_index()
print(quantity_sale)
quantity_store=data.groupby(['product', 'store']).agg({'quantity': 'sum'}).reset_index()
print(quantity_store)
product_not_sold=data[ data['quantity']==0]['product'].unique()
print(product_not_sold)
customer_no_purchase=data [data[quantity]==0]['customer'].unique()
print(customer_no_purchase)
aW1wb3J0IHBhbmRhcyBhcyBwZAoKZGF0YT17J3Byb2R1Y3QnOlsncHJvZHVjdF9BJywncHJvZHVjdF9CJywncHJvZHVjdF9DJywncHJvZHVjdF9EJ10sCgoncXVhbnRpdHknOlsxMCwyMCwzMCw0MF0sCgonc2FsZXMnOlsxMDAsMjAwLDMwMCw0MDBdLAoKJ3N0b3JlJzpbJ3N0b3JlMScsJ3N0b3JlMicsJ3N0b3JlMycnc3RvcmU0J10sCgonY3VzdG9tZXInOlsnY3VzdG9tZXIxJywnY3VzdG9tZXIyJywnY3VzdG9tZXIzJywnY3VzdG9tZXI0J119CgpkYXRhID0gcGQuRGF0YUZyYW1lKGRhdGEpCgpwcmludChkYXRhKQoKcHJvZHVjdF9zb2xkPWRhdGFbZGF0YVsncXVhbnRpdHknXT4wXSBbJ3Byb2R1Y3QnXS51bmlxdWUoKQoKcHJpbnQocHJvZHVjdF9zb2xkKQoKcXVhbnRpdHlfc29sZD1kYXRhLmdyb3VwYnkoWydwcm9kdWN0J10pWydxdWFudGl0eSddLnN1bSgpLnJlc2V0X2luZGV4KCkKCnByaW50KHF1YW50aXR5X3NvbGQpCQoKcXVhbnRpdHlfc2FsZV9kYXRhLmdyb3VwYnkoWydwcm9kdWN0J10pLmFnZyh7J3F1YW50aXR5JzogJ3N1bScsICdzYWxlcyc6ICdzdW0nfSkucmVzZXRfaW5kZXgoKQoKcHJpbnQocXVhbnRpdHlfc2FsZSkKCnF1YW50aXR5X3N0b3JlPWRhdGEuZ3JvdXBieShbJ3Byb2R1Y3QnLCAnc3RvcmUnXSkuYWdnKHsncXVhbnRpdHknOiAnc3VtJ30pLnJlc2V0X2luZGV4KCkKCnByaW50KHF1YW50aXR5X3N0b3JlKSAKCnByb2R1Y3Rfbm90X3NvbGQ9ZGF0YVsgZGF0YVsncXVhbnRpdHknXT09MF1bJ3Byb2R1Y3QnXS51bmlxdWUoKQoKcHJpbnQocHJvZHVjdF9ub3Rfc29sZCkKCmN1c3RvbWVyX25vX3B1cmNoYXNlPWRhdGEgW2RhdGFbcXVhbnRpdHldPT0wXVsnY3VzdG9tZXInXS51bmlxdWUoKQoKCnByaW50KGN1c3RvbWVyX25vX3B1cmNoYXNlKQ==
import pandas as pd
data={'product':['product_A','product_B','product_C','product_D'],
'quantity':[10,20,30,40],
'sales':[100,200,300,400],
'store':['store1','store2','store3''store4'],
'customer':['customer1','customer2','customer3','customer4']}
data = pd.DataFrame(data)
print(data)
product_sold=data[data['quantity']>0] ['product'].unique()
print(product_sold)
quantity_sold=data.groupby(['product'])['quantity'].sum().reset_index()
print(quantity_sold)
quantity_sale_data.groupby(['product']).agg({'quantity': 'sum', 'sales': 'sum'}).reset_index()
print(quantity_sale)
quantity_store=data.groupby(['product', 'store']).agg({'quantity': 'sum'}).reset_index()
print(quantity_store)
product_not_sold=data[ data['quantity']==0]['product'].unique()
print(product_not_sold)
customer_no_purchase=data [data[quantity]==0]['customer'].unique()
print(customer_no_purchase)