Last answered:

16 Nov 2022

Posted on:

11 Nov 2021

1

What are the benefits of del command?

Is there a benefit to deleting the columns from the dataframe instead of using the .drop-method or assigning the spx-series to a new variable?

1 answers ( 0 marked as helpful)
Posted on:

16 Nov 2022

0

Not sure of any benefits, i know drop method is faster and more "user friendly, ie can be performed with one line for multiple columns :
df_comp.drop(['spx','dax','ftse','nikkei'],axis=1inplace=True)
df_comp.drop(df_comp.columns[[0,1,2,3]],axis=1inplace=True)

Submit an answer