1
votes

Note: I know the problem but I need solution , Thanks.

I am trying to read a pandas dataframe which has two columns and something like this

| Problems | Findings |
|  ---     |    ---   |

I am also reading images from the images path and then append these two features with image names.

for images in os.listdir(path):
 for row in df["findings"]:
  for row1 in df["Problems"]:
   # check if the image ends with png
   if (images.endswith(".png") or images.endswith(".jpg")
    or images.endswith(".jpeg")):
    # display
    #print(images)
    #caption = f"{caption.lower().rstrip('.')}"
    #caption = f"{caption.rstrip('.')}"
    #caption = caption.split('/', expand=True) #.str.lower().str.rstrip('.')
    caption = row
    problems = row1
    #caption = f"{caption.str.rstrip('.')}"
    #caption = f"{caption.rstrip('.')}"
    #image_p = images 
    image_path = os.path.join(path, images)
    image_path_to_caption[image_path].append(caption, problems)

When I run this code it generates the above error. Is there any way to pass both of them?

You can't do .append(caption, problems) You can only pass one argument to append - JacobIRR
Any solution because I need it to pass both of them? - albert
We need to see the image_path_to_caption data structure, and the resulting change you wish to achieve using append - JacobIRR
Ok this the PATH to my colab. - albert
Not the path to your colab, but the image_path_to_caption data structure. We need to know what are you trying to append and to what are you trying to append that. - Ignatius Reilly