Skip to content
Advertisement

Order in dataframe generation

Could you explain to me why the Properties column was the third column and not the first one? As you can see I insert it as the first in pd.DataFrame, but when I do print(df), it appears as the third column.

JavaScript

enter image description here

Advertisement

Answer

Try using columns argument to assign the order of columns:

JavaScript

This gives:

JavaScript
Advertisement