This script is a simplified version of what I have as its too long to put here. I have tried to include all necessary information.
class data():
def collect_data(self):
def reader(n):
self.df[n] = self.join_data(self.EO[n].real)
# for i in (1, 2, 4, 6): reader(i)
def join_data(self, func1)
do stuff
return self.df # is a Series
def data_excel(self)
self.df[1].to_excel(......) #line 1
self.df[2].to_excel(......)
self.df[4].to_excel(......)
self.df[6].to_excel(......)
#on line 1
AttributeError: 'str' object has no attribute 'to_excel'
The Series contains chunks of "strings and numeric" data where each chunk starts with row index 0.
print(dfEO_RI.head(1).to_dict())
{0: '*amplitude'}
{0: '*amplitude'}
{0: '*amplitude'}
{0: '*amplitude'}
The function join_data successfully returns a Series but I dont know how to correctly pass it through the function collect_data and subsequently to function data_excel
Desired Output
4 Series data output to excel