Guest User

Untitled

a guest
Jun 25th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. def process_df(self, df, conditions):
  2. resultant_df = self.data_frame
  3. if conditions[2]=='trail':
  4. 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]]}},
  5. 1:{'group':{resultant_df.groupby(new_df[0][filter])}}}
  6. print (new_df[1][group])
  7.  
  8.  
  9.  
  10. if __name__ == '__main__':
  11. sample = sample()
  12. sample.create_df("/home/purpletalk/GrammarandProductReviews.csv")
  13. df = sample.get_resultant_df(['brand', 'reviews.id','manufacturer','reviews.title','reviews.username','id','dateAdded','reviews.rating'])
  14. new_df = sample.process_df(df, ['brand','manufacturer','trail','Windex', 'size', 'equal',8,700,'AMBI'])
  15. A=new_df
  16. print A
Add Comment
Please, Sign In to add comment