昨天整理了知识点,今天复盘时,发现了error,巩固dataframe的用法。
file3 = pd.DataFrame(data = {'Gender':['M','F'],
'Height':[155,160,175,180],
'Weight':[50,48,52,65]},
index = ['row%d'%i for i in range(4)])
file3
ValueError: Shape of passed values is (2, 3), indices imply (4, 3)
ValueError:传递值的形状是(2,3),索引是(4,3)
因此我修改了数据,且data里的数据数量得保持一致!
file3 = pd.DataFrame(data = {
'Height':[155,160,175,180],
'Weight':[50,48,52,65]},
index = ['row%d'%i for i in range(4)])
file3
Height Weight
row0 155 50
row1 160 48
row2 175 52
row3 180 65
data = pd.DataFrame([[index, uri_data_list, first_data]]
, columns=['index', 'uri_list', 'first_uri'])