Skip to content

Instantly share code, notes, and snippets.

@chiaoyaaaaa
Created September 12, 2020 06:06
Show Gist options
  • Save chiaoyaaaaa/409d5e6b80b05a5a5b2e3ddf1a278da6 to your computer and use it in GitHub Desktop.
Save chiaoyaaaaa/409d5e6b80b05a5a5b2e3ddf1a278da6 to your computer and use it in GitHub Desktop.
clean like list
for i in range(len(like)):
# 處理出現 '\xa0萬' 的數值
if(like[i].find('\xa0萬') != -1):
like[i] = int(float(like[i][:like[i].find('\xa0萬')])*10000)
# 處理有出現 ',' 的數值
else:
like[i] = int(like[i].replace(',',''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment