Skip to content

Instantly share code, notes, and snippets.

@bgweber
Last active September 7, 2020 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgweber/8f0252fe4f76ada812e5c3710367c15d to your computer and use it in GitHub Desktop.
Save bgweber/8f0252fe4f76ada812e5c3710367c15d to your computer and use it in GitHub Desktop.
import pandas as pd
df = pd.read_csv("game_skater_stats.csv")
df = df[df['player_id'] == 8467412]
print(df.head(3))
for index, row in df.iterrows():
event = { "playerID": int(row['player_id']), "Game_ID": int(row['game_id']),
"goals": int(row['goals']), "assists": int(row['assists']),
"shots": int(row['shots']), "hits": int(row['hits']) }
print(event)
requests.post("http://localhost:5000/update", json = event)
prediction = requests.get("http://localhost:5000/score?playerID=8467412")
print(prediction.json())
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment