I have a data frame as shown below.it's name is 'df_thd_funct' .I need to apply logarithmic equation on xvalue columns and need to create a new column.Below is my code.
df_thd_funct['sensi'] = 20*(np.log(df_thd_funct.xvalues/1.44))
xvalues SFM_376_1.62_-40
0.0189 0.0190
0.0200 0.0187
0.0225 0.0167
0.0239 0.0191
The error I am getting is given below. What am I missing?
My complete code is given below.
df_thd_funct = pd.read_csv("A2_THD_Ratio_Stepped_Sweep_Corners_PVT_lab01.txt",delim_whitespace=True,index_col=False)
df_thd_funct.set_index('xvalues', inplace=True)
check_for_nan = df_thd_funct.isnull().values.any()
df_thd_funct = df_thd_funct.T
print (check_for_nan)
df_thd_funct.head()
After running df_thd_funct['sensi'] = df_thd_funct['xvalues'].apply(lambda x: 20*(np.log(x/1.44)))
The new error obtained is given below.


20 * (df['xvalues'] / 1.44).apply(np.log)