Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #create a dataframe from the lists
  2. df = pd.DataFrame({'outcomes':o,'bet_price':b, 'title':t})
  3. #add a field for the current timestamp
  4. df['date'] = now
  5. #replace "EVEN" with zero and store data as a float
  6. df['bet_price']=df['bet_price'].replace('EVEN', '0')
  7. df.bet_price = df.bet_price.astype(float)
  8.  
  9. #append this dataframe we created with our historical data
  10. try:
  11. df = in_df.append(df)
  12. except Exception:
  13. pass
  14.  
  15. #save off the file, overwriting the existing
  16. df.to_csv(file, index = None)
  17. df = pd.read_csv(file)
  18.  
  19. #close the browser
  20. browser.close()
  21.  
  22. #return the dataframe so it can be used for visualization and data analysis
  23. return df
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement