Python: Divide each row of a DataFrame by another DataFrame vector

前端 未结 5 2081
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 20:26

I have a DataFrame (df1) with a dimension 2000 rows x 500 columns (excluding the index) for which I want to divide each row by another DataFrame (df2) with dime

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 20:53

    If you want to divide each row of a column with a specific value you could try:

    df['column_name'] = df['column_name'].div(10000)
    

    For me, this code divided each row of 'column_name' with 10,000.

提交回复
热议问题