Oct-17-2020, 11:13 AM
Hi Buran
Thank you for your response.
I think I understand, if no column names are specified in the dataframe then the values in the square brackets are the column index numbers.
If column names are specified then the name of the column needs to be included inside the square brackets - would this be correct?
I personally prefer to use row and column index numbers through the iloc command:-
Although the change you suggested which was to add the column names works:-
I am not certain why this is?
Thank you for your response.
I think I understand, if no column names are specified in the dataframe then the values in the square brackets are the column index numbers.
If column names are specified then the name of the column needs to be included inside the square brackets - would this be correct?
I personally prefer to use row and column index numbers through the iloc command:-
df_raw_data.iloc[:,5] = df_raw_data.iloc[:,3] * 1760 + df_raw_data.iloc[:,4]But i guess both achieve the same thing.
Although the change you suggested which was to add the column names works:-
raw_data['Column_5'] = raw_data['Column_3'] * 8950 + raw_data['Column_4']This works however the arithmetic does not for example the values in column 5 is 2182181218218..., the code just copies the value from Column3 8950 times???
I am not certain why this is?