Hello,
I’ve had this same error. It’s due to there being nonetypes in your data. So when you are creating your dataframe from the data, change your code to specify values, and convert it to a list:
for i in data.index.values.tolist():

If you’re still having issues after that, try the following code on your dataframe object:
df = df.dropna()

Hope this helps you, good luck.