我有一个列,其中的行具有如下字符串:
{"Manufacture":"1920","Comapany":"(BMW)","Loss":"(20)","price":"93"}
{"Manufacture":"1911","price":"20","shutdown":"(13)"}
我想将(数字)条目转换为-number 例如,在第一行输入输出将是
{"Manufacture":"1920","Comapany":"(BMW)","Loss":"-20","price":"93"}
损失分录为(20),转换为-20
第二行条目也是如此
{"Manufacture":"1911","price":"20","shutdown":"-13"}
试试看:
示例:
res:
结果:
编辑:
假设您的df为:
df:
相关问题 更多 >
编程相关推荐