首页 > 解决方案 > 更改其他 DataFrame 中的 DataFrame 行的值?

问题描述

我想更改另一个 DataFrame 列/系列中包含的 DataFrame 的 ros 值。

我有 2 个数据框:

  1. 方法:
means.columns = Index(['Date', 'a_min', 'a_cierre', 'a_max',
                       'b_min', 'b_cierre', 'b_max', 'conj'], dtype='object')
  1. 排:
pai.columns = Index(['mes', 'direccion', 'accion', 'min', 'cierre', 'max', 'Date'],
                    dtype='object')

下一个代码很适合我的问题:

for x in pai.Date:
    means[means.Date==x] = 9999

但我只想把它写在一行中。

标签: pythonpandas

解决方案


推荐阅读