Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将价格转换为 int,在价格列中包含“,”和“-”等字符
我用apply++ lambda,replace没有错误,但似乎还没有改变。在更改为 int 之后,如何删除所有字符“,”?
apply
lambda
replace
df.loc[:, '수출건수':'무역수지'].apply(lambda x : x.replace(',',''))
和
df.loc[:, '수출건수':'무역수지'].astype(int)
错误 = 以 10 为基数的 int() 的无效文字:'1,721,193'
样本