Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def process_df(self, df, conditions):
- resultant_df = self.data_frame
- if conditions[2]=='trail':
- new_df={0:{'filter'{'filter1':resultant_df.loc[resultant_df[conditions[0]] == conditions[8]]},'filteer':{'filter1':resultant_df.loc[resultant_df[conditions[0]] == conditions[8]]}},
- 1:{'group':{resultant_df.groupby(new_df[0][filter])}}}
- print (new_df[1][group])
- if __name__ == '__main__':
- sample = sample()
- sample.create_df("/home/purpletalk/GrammarandProductReviews.csv")
- df = sample.get_resultant_df(['brand', 'reviews.id','manufacturer','reviews.title','reviews.username','id','dateAdded','reviews.rating'])
- new_df = sample.process_df(df, ['brand','manufacturer','trail','Windex', 'size', 'equal',8,700,'AMBI'])
- A=new_df
- print A
Add Comment
Please, Sign In to add comment