我有一个 year | brand | total money earned
2018 nike 5000000000
2018 adidas 498000000
2019 nike 30000000000
,类型为albumCollection
。我的vector<Album*>
类又拥有一个Album
。效果很好:
vector<Track*>
但是尝试一下:
for(Album* i : albumCollection) {
cout << i;
}
我得到了错误:
for(Album* i : albumCollection) {
for (Track* j : i) {
cout << j;
}
}
和:
no callable 'begin' function found for type 'Album *'
答案 0 :(得分:3)
您需要每个# Create an empty dataframe with column names
dffinal = pd.DataFrame(columns=['parent','child','numeric_result_list'])
# Group by 'parent' and 'child'
parent_child = df2.groupby(['parent', 'child'])
i = 1
for name, group in parent_child:
print('Processing: ', name)
group = group.reset_index(drop=True)
_array2d_ = make2dList(rows, cols)
_array2d_ = modify2dlist(_array2d_, _group_)
dffinal.loc[i] = [name[0], name[1], _array2d_]
i = i+1
print('done')
dff = dff.reset_index(drop=True)
中包含的向量在嵌套循环中的Limitations
的右侧。看起来像
Album