Commit
•
e01039c
1
Parent(s):
b5c7a55
Update handler.py
Browse filesYou are loading a {"inputs": {{"customerID": {"0": "7590-VHVEG", "1": "5575-GNVDE", ...}} as dataframe -> which ends up as 1 column thats why you receive the `KeyError`.
- handler.py +1 -1
handler.py
CHANGED
@@ -22,7 +22,7 @@ class EndpointHandler():
|
|
22 |
"""
|
23 |
inputs = data.pop("inputs", data)
|
24 |
parameters = data.pop("parameters", None)
|
25 |
-
df = pd.DataFrame(
|
26 |
|
27 |
df["TotalCharges"] = df["TotalCharges"].replace(" ", np.nan, regex=False).astype(float)
|
28 |
df = df.drop(columns=["customerID"])
|
|
|
22 |
"""
|
23 |
inputs = data.pop("inputs", data)
|
24 |
parameters = data.pop("parameters", None)
|
25 |
+
df = pd.DataFrame(inputs)
|
26 |
|
27 |
df["TotalCharges"] = df["TotalCharges"].replace(" ", np.nan, regex=False).astype(float)
|
28 |
df = df.drop(columns=["customerID"])
|