Python Forum
TypeError: 'Series' object cannot be interpreted as an integer - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Data Science (https://python-forum.io/Forum-Data-Science)
+--- Thread: TypeError: 'Series' object cannot be interpreted as an integer (/Thread-TypeError-Series-object-cannot-be-interpreted-as-an-integer)



TypeError: 'Series' object cannot be interpreted as an integer - evelynow - Aug-20-2019

TypeError: 'Series' object cannot be interpreted as an integer

how do i solve this issue?
i am trying to apply my user defined function to a pandas dataframe. the 4 arguments in the function are the values from the 4 columns of my dataframe.

python highlight my 4 arguments as error

my panda data frame have 200 rows and 4 columns.


RE: TypeError: 'Series' object cannot be interpreted as an integer - scidam - Aug-20-2019

It would be better, if you post your code here.


RE: TypeError: 'Series' object cannot be interpreted as an integer - timmahoney - Sep-11-2019

I have the same issue. Here is my code and a sample of the output.
import os
import sys
import matplotlib
from matplotlib.ticker import FuncFormatter
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
import datetime
import ffn
import pandas as pd
import numpy as np
import pymysql

.
.
.
.
.
wcursor.execute(sql_sel_wact, get_esiid)

esi_records = list(wcursor.fetchall())

incr = []
i = 0
while i < len(esi_records):
	incr.append(i)
	i += 1

for e in incr:
    print(e)


esi_df = pd.DataFrame(esi_records, columns=['Date','Time','Energy'])

esi_df.insert(3, "incr", incr, True)
print(esi_df)

print(esi_df.describe())
print(esi_df.info())
print(esi_df.dtypes)

plot_heatmap(esi_df)
sys.exit()
[Image: B2RkfwjHutA]

Any help is appreciated.