I'm new to pandas and the dataframe-concept. Because of the format of my data (excel-sheets, first row is the name of my data, the second row is the unit) it's a little tricky to handle it in a data frame.
The task is to calculate new data from existing columns, e.g. df.['c'] = df['a']**2 + df.['b']
I get: TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
This did work, but is pain to my hands and eyes:
df.['c'] = df['a']
df.['c'] = df['a'].tail(len(df.['a']-1))**2 + df.['b'].tail(len(df.['b'])-1)
df.loc[0,'c'] = 'unit for c'
Is there any way to do this quicker or with less typing? Thanks already schamonn