0

Having this:

import pandas as pd
df = pd.DataFrame([[1,2,3,8],[33,44,55,9],[555,556,222,10]])
df.columns = ['Al', 'Bandy', 'George', 'Zulu']

I get this:

enter image description here

I need a list of lists only from columns Bandy and George, that results exactly like this:

[[2,3], [44,55],[556, 222]]

So far I have managed with the code below and the result is a reversed dataframe, but I am quite sure there should be a better way than reversing it back:

pd.DataFrame(list([df['Bandy'], df['George']]))
Vityata
  • 42,633
  • 8
  • 55
  • 100

0 Answers0