I've tried to scale the values in the dataframe by a factor of 10 to the 6th power, but the results don't show any change.

Energy['Energy Supply'].apply(lambda x: x*(10**6))
Energy.head()

CodePudding user response:
You don't need to use apply, just use compound assignment operators:
Energy['Energy Supply'] *= 1e6
CodePudding user response:
You have to add the = operator. DataFrames are not mutable like lists, therefore you have to store the value in the column: Energy['Energy Supply'] = ....
Energy['Energy Supply'] = Energy['Energy Supply'].apply(lambda x: x*(10**6))
Energy.head()
