我想排除数据框中的某些列:
neatDf = select(df, :Response_ID, Not([:IP_Address, :Progress, :Finished, :User_Language, :Distribution_Channel, :Response_Type]))
以上作品。但是,当我想使用正则表达式包含第二个不排除列时,它不起作用:
neatDf = select(df, :Response_ID, Not([:IP_Address, :Progress, :Finished, :User_Language, :Distribution_Channel, :Response_Type]), Not(r"^Recipient"))
我可以像上面那样连续使用两个Not
吗?
最佳答案
如果你想删除两个条件的并集,那么我认为最简单的方法是执行以下操作(即你在选择器的并集上使用 Not
;你可以使用 计算这样的并集列数
):
select(df, :Response_ID, Not(Cols([:IP_Address, :Progress, :Finished, :User_Language, :Distribution_Channel, :Response_Type], r"^Recipient")))
关于julia - 使用两个 Not in select,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73980840/