Created
September 12, 2020 06:06
-
-
Save chiaoyaaaaa/409d5e6b80b05a5a5b2e3ddf1a278da6 to your computer and use it in GitHub Desktop.
clean like list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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