Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #create a dataframe from the lists
- df = pd.DataFrame({'outcomes':o,'bet_price':b, 'title':t})
- #add a field for the current timestamp
- df['date'] = now
- #replace "EVEN" with zero and store data as a float
- df['bet_price']=df['bet_price'].replace('EVEN', '0')
- df.bet_price = df.bet_price.astype(float)
- #append this dataframe we created with our historical data
- try:
- df = in_df.append(df)
- except Exception:
- pass
- #save off the file, overwriting the existing
- df.to_csv(file, index = None)
- df = pd.read_csv(file)
- #close the browser
- browser.close()
- #return the dataframe so it can be used for visualization and data analysis
- return df
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement