I have tried various methods to add new column to a Panda dataframe but I get the same result.
Methods tried:
call_duration is a list having same number of items as in the data frame.
df['Duration_sec'] = pd.Series(call_duration,index=np.arange(len(df)))
and
df['Duration_sec'] = pd.Series(call_duration,index=df.index)
and
# df['Duration_sec'] = np.array(call_duration)
All three gave the same result as under-
I don't understand why the new column is added to new line? And why is there a \ at the end of the first line?