我无法将数据转换为十亿单位。现在,我的数据由整数组成,例如12000000000。我希望它的单位是120亿。现在,我不想说10亿,我只想数字变成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
我认为我最大的麻烦是第一个错误,因为我的列表中有一个单词,而其他的都是数字或值。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐