Pandas: how to change all the values of a column?

前端 未结 3 1953
余生分开走
余生分开走 2020-12-12 12:51

I have a data frame with a column called \"Date\" and want all the values from this column to have the same value (the year only). Example:

City         


        
3条回答
  •  抹茶落季
    2020-12-12 13:09

    Or if one want to use lambda function in the apply function:

    data['Revenue']=data['Revenue'].apply(lambda x:float(x.replace("$","").replace(",", "").replace(" ", "")))
    

提交回复
热议问题