Python Forum
Need help creating complex loop around existing script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help creating complex loop around existing script
#4
Is the problem that it only works for "Image1.jpg" and that you need a way for it to work for each filename? You still have the filenames in FandC (btw, using fandc for the dataframe variable is really confusing). You can use FandC to get the image filename.
master_df=pd.DataFrame(FandC)
    #creates a dataframe for "filename", "x", "y", and "r".

# for each filename, get the dataframe and process
for img in FandC:
    img_filename = img.['filename']
    img_df = master_df[master_df['filename'] == img_filename]
Reply


Messages In This Thread
RE: Need help creating complex loop around existing script - by deanhystad - Apr-15-2020, 12:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Button to stop while loop from another script Absolutewind 5 978 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  Python beginner that needs an expression added to existing script markham 1 739 Sep-04-2023, 05:24 AM
Last Post: Pedroski55
  [SOLVED] [Linux] Script in cron stops after first run in loop Winfried 2 959 Nov-16-2022, 07:58 PM
Last Post: Winfried
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,548 Jul-27-2022, 08:50 PM
Last Post: rob101
  how to loop a script? ZYSIA 1 2,045 Jul-22-2021, 06:46 AM
Last Post: Gribouillis
  creating a loop yk303 2 1,891 Feb-08-2021, 08:41 PM
Last Post: nilamo
  Help with Creating a Script for Automating Reports SunWers 1 1,955 Dec-29-2020, 10:21 PM
Last Post: jjc385
  Creating a variables inside FOR loop zazas321 5 4,160 Sep-16-2020, 04:42 PM
Last Post: Naheed
  Creating Complex Color Spectrum Plot From Data JoeDainton123 2 2,163 Sep-15-2020, 08:09 AM
Last Post: DPaul
  Need help creating a simple script Nonameface 12 4,696 Jul-14-2020, 02:10 PM
Last Post: BitPythoner

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020