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?
.append(caption, problems)You can only pass one argument toappend- JacobIRRimage_path_to_captiondata structure. We need to know what are you trying to append and to what are you trying to append that. - Ignatius Reilly