我想在列表中添加我在excel表格读取的内容,并将内容输出,但是我只能得到内容带有单引号的列表,如下结果。
错误代码:
import pandas as pd
import numpy as np
l = []
for i in range(5):
df = pd.read_excel('C:/Users/Administrator/Desktop/data(1)/1/1.xls')
l.append((df.values[i,0]))
print(l)
错误结果:
import pandas as pd
import numpy as np
l = []
for i in range(5):
df = pd.read_excel('C:/Users/Administrator/Desktop/data(1)/1/1.xls')
l.append(list(eval(df.values[i,0])))
print(l)