我无法将数据转换为十亿单位。现在,我的数据包括整数,例如12,000,000,000。我希望它以120亿为单位。现在,我不想让它说十亿,我只想把这个数字改为12。
wb = UpdateWorkbook(r'C:\Users\vince\Project\Spreadsheet.xlsx', worksheet=1)
df_2 = fd_frames['income_statement']
a = df_2.values[0].astype('int64') #This is where I get the error
b = a/(1000000000) #This is what I was thinking of doing, but it doesn't work
wb['M6:T6'] = df_2.values[0] #
wb.save()
每当我尝试将列表转换为整数时,我都会遇到多次错误,以下是一些:
ValueError: invalid literal for int() with base 10: 'Revenue'
OverflowError: Python int too large to convert to C long
我认为我最大的麻烦是第一个错误,因为我的列表中有一个单词,而其他所有单词都是数字或值。