pandas loc筛选使用多条件

    if val in tab['值'].values:
        if time in tab['日期'].values:
            tab3.loc[(tab['日期'] == time) & (tab['值'] == val)] = a

我试了这样的,还有

    if val in tab['值'].values:
        if time in tab['日期'].values:
            tab3.loc[tab['日期'] == time and tab['值'] == val] = a

都给我报错

你好,你的数据形式长什么样子,能看一下麽

这种数据筛选还是 用pandas 处理好
如有帮助,请点击我评论上方【采纳该答案】按钮支持一下。