I have started exploring pandas recently, I am trying to import a list of fruits from sector.py and use it as a filter to produce a table of items where only fruits within the list are displayed. I am not getting the output desired is there something wrong with my codes?
Within sector.py
Fruits=['Apple','Orange','Pineapples']
Within calculator.py
import sector
import pandas as pd
pdmart = pd.read_csv('supermarket.csv')
pdextract = pdmart.groupby('item')['price'].sum()
Fruits = pdextract[pdextract.isin(sector.Fruits)]
print Fruits
Current output:
Series([], Name: price, dtype: float64)
Desired output:
Item Price
Apple 12.0
Orange 7.0
Pineapples 15.0