更改其他数据帧中的数据帧行的值?

2024-05-15 20:38:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我想更改包含在另一个数据帧列/序列中的数据帧的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

但我只想写一行


Tags: columns数据dateindexobject序列rosmin