Hello everyone I'm in the final step of my program to send in calendar but I can't seem to get my for loop to perform the function over the list. It only reads for 1 of the 3 in list. Here is my code below.
Order List = ['0730049','4291200','1830470']
for eachId in Order_List:
**Code to create orders into excel sheet.**
df_list = [f'OrderId_{eachId}.xlsx']
print(df_list)
***everything works fine up until here ***
for eachOrder in df_list:
df = pd.read_excel (eachOrder,engine='openpyxl')
New_Order_Date= df.iat[0,3]
Order_obj_date= datetime.strptime(New_Order_Date,'%m/%d/%Y').date()
print(Order_obj_date)
my df_list when I print shows me my list of .xlsx files created output :
'0730049.xlsx','4291200.xlsx','1830470.xlsx'
But now I need the New_Order_Date to read in each excel file properly and find the date which is at cell value (D,2). Currently, my formula for one excel file, the df. iat[0,3] works perfectly. How can I get it to perform that same search for each of the df_list?
hopefully, this makes sense? but the current code that works for 1 file when printed to give everyone an idea equals:
New_Order_Date=df.iat[0,3]
output: 07-01-2022
expected output;
0730049.xlsx= 07-01-2022
4291200.xlsx= 07-04-2022
1830470.xlsx= 07-27-2022
#comments rather than**text for your commentary about it.df_lista list if it always has just one element?'0730049.xlsx','4291200.xlsx','1830470.xlsx'but I wrote it like that so I didnt manual have to add the order excels.