I have a DataFrame that contains references to rows in another DataFrame in list format.
I need to collect a new data frame from the specified rows and add another new column to them summarizing the values of the first DataFrame.
To make it clearer, made the scheme. I need to collect a DataFrame like the one on the bottom.
# DataFrame c данными data = { 'apples': [3, 2, 1, 4, 5, 0, 4, 2, 1], 'oranges': [3, 0, 4, 2, 1, 2, 3, 7, 2], 'tomat': [1, 1, 4, 2, 8, 6, 4, 7, 2] } df = pd.DataFrame(data) # DataFrame c указанием номеров строк в первом maps = { 'cat': [3, 0, 4], 'sklad': [1, 5, 2], 'vec': [[3, 2, 1], [4, 0], [1, 5, 3, 2]] } dfv = pd.DataFrame(maps) I began to do everything through cycles and conditions, and I understand that this is highly redundant and unstable. Tell me, how is it correct to choose vectors based on lists in Pandas and add more calculated values?

dfordfvin question)? - MaxU pm