熊猫将带有符号(“,”,“-”)的价格转换为整数

时间:2020-08-13 21:24:57

标签: python pandas

我想将价格转换为int,在价格列中包含“,”和“-”之类的字符

我使用了$FilePath = 'c:\\NewFolder\*.*' # enter the File path here $yesterday = Get-Date -Hour 22 -Minute 0 -Second 0 # file update 3-5 AM EST # get an array of full filenames for any file that was last updates in the last 24 hours $files = (Get-ChildItem -Path $FilePath -Filter '*.*' -File | Where-Object { $_.LastWriteTime -ge $yesterday }).FullName if ($files) { $message = 'These files were modified in the last 24 hours:{0}{1}' -f [Environment]::NewLine, ($files -join [Environment]::NewLine) } else { $message = 'There were no files modified in the last 24 hours' # fire command to AppD } # output on screen Write-Host $message # Output Message push to REST API + apply + lambda,没有错误,但似乎还没有改变。更改为int后,如何删除所有字符“,”?

replace

df.loc[:, '수출건수':'무역수지'].apply(lambda x : x.replace(',',''))

错误= int()以10为底的无效文字:'1,721,193'

Sample

0 个答案:

没有答案