1

I have a pandas dataframe where its column has a length of 256. How can I extract a column in order to create a 16*16 image and show it? My problem is I don't know to choose a column a create a 16*16 object

I tried with pivot but this doesn't solve my problem

Er1Hall
  • 147
  • 2
  • 11

1 Answers1

1

Select column, convert to numpy array and reshape:

arr = df['col'].values.reshape(16, 16)
jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252