Skip to content

Instantly share code, notes, and snippets.

@nicoforteza
Created June 25, 2019 08:29
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 nicoforteza/2b46ef2f3ccf7c9bb7966df7b23cc0ee to your computer and use it in GitHub Desktop.
Save nicoforteza/2b46ef2f3ccf7c9bb7966df7b23cc0ee to your computer and use it in GitHub Desktop.
import pandas as pd
import requests
import json
# API url
url = "http://0.0.0.0:5000/ad"
# data path
data = "dir/input/data/test/X.csv"
# load data to test the API - we are not testing the model!
x = pd.read_csv(data, index_col=0)
# make the post
print(requests.post(url, data=json.dumps(x.to_dict())).content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment