0

I have a excel file which looks below

Name, Image
iris, jpgimage
rose,jpgimage

Image column contains images of the Name column. I tried to read the file but image column coming as Nan

import pandas as pd
df = pd.read_excel('z.xlsx')
  • Adding on more question can i save the images with name of first column?

Is there any alternate way to save the images with name of first column?

Like in folder it will save as rose.jpg, iris.jpg

  • 2
    I'm not sure if pandas has the ability to read images (like a matrix of pixel intensities or.), in order to extract and save the images, check this [link](https://stackoverflow.com/questions/54980439/use-python-extract-images-from-excel-sheets) – tidakdiinginkan May 05 '20 at 04:50
  • @tidakdiinginkan, pandas is not necessary as python also will take care of things but how to save `save the images with name of first column?` –  May 05 '20 at 05:00
  • Does this answer your question? [Use python extract images from Excel sheets](https://stackoverflow.com/questions/54980439/use-python-extract-images-from-excel-sheets) – Joe May 05 '20 at 06:07
  • https://stackoverflow.com/search?q=python+extract+image+excel – Joe May 05 '20 at 06:07
  • @Nons how are you saving images currently? – tidakdiinginkan May 05 '20 at 06:56
  • @tidakdiinginkan, not able to do in python, went through the link https://stackoverflow.com/questions/54980439/use-python-extract-images-from-excel-sheets, but image is not getting saved –  May 05 '20 at 06:58
  • @tidakdiinginkan ` if shape.Name.startswith('Picture'):` there is no line with starting with picture –  May 05 '20 at 07:02
  • @Nons after this line `if shape.Name.startswith('Picture'):`, can you write `print(i, shape.Name)` and let me know what's printed? – tidakdiinginkan May 05 '20 at 07:14
  • @Nons I think it's standard excel naming convention for pictures embedded inside it, I tried the code and it works perfectly for me. The 2 images i used for testing were read as `Picture 2` and `Picture 4` – tidakdiinginkan May 05 '20 at 07:32
  • @tidakdiinginkan, i tried the code now, only 235 images was there in the excel but i got so many small pixel images also. –  May 07 '20 at 04:21
  • @Nons the code grabs clipboard images, so it'll be able to capture the image in the exact size as pasted in the excel sheet. – tidakdiinginkan May 07 '20 at 09:03

0 Answers0