<jupyter_start><jupyter_text>List of names of all the files<jupyter_code>List_fileName=[
'TAXRATES_ZIP5_AK201903.csv',
'TAXRATES_ZIP5_AL201903.csv',
'TAXRATES_ZIP5_AR201903.csv',
'TAXRATES_ZIP5_AZ201903.csv',
'TAXRATES_ZIP5_CA201903.csv',
'TAXRATES_ZIP5_CO201903.csv',
'TAXRATES_ZIP5_CT201903.csv',
'TAXRATES_ZIP5_DC201903.csv',
'TAXRATES_ZIP5_DE201903.csv',
'TAXRATES_ZIP5_FL201903.csv',
'TAXRATES_ZIP5_GA201903.csv',
'TAXRATES_ZIP5_HI201903.csv',
'TAXRATES_ZIP5_IA201903.csv',
'TAXRATES_ZIP5_ID201903.csv',
'TAXRATES_ZIP5_IL201903.csv',
'TAXRATES_ZIP5_IN201903.csv',
'TAXRATES_ZIP5_KS201903.csv',
'TAXRATES_ZIP5_KY201903.csv',
'TAXRATES_ZIP5_LA201903.csv',
'TAXRATES_ZIP5_MA201903.csv',
'TAXRATES_ZIP5_MD201903.csv',
'TAXRATES_ZIP5_ME201903.csv',
'TAXRATES_ZIP5_MI201903.csv',
'TAXRATES_ZIP5_MN201903.csv',
'TAXRATES_ZIP5_MO201903.csv',
'TAXRATES_ZIP5_MS201903.csv',
'TAXRATES_ZIP5_MT201903.csv',
'TAXRATES_ZIP5_NC201903.csv',
'TAXRATES_ZIP5_ND201903.csv',
'TAXRATES_ZIP5_NE201903.csv',
'TAXRATES_ZIP5_NH201903.csv',
'TAXRATES_ZIP5_NJ201903.csv',
'TAXRATES_ZIP5_NM201903.csv',
'TAXRATES_ZIP5_NV201903.csv',
'TAXRATES_ZIP5_NY201903.csv',
'TAXRATES_ZIP5_OH201903.csv',
'TAXRATES_ZIP5_OK201903.csv',
'TAXRATES_ZIP5_OR201903.csv',
'TAXRATES_ZIP5_PA201903.csv',
'TAXRATES_ZIP5_PR201903.csv',
'TAXRATES_ZIP5_RI201903.csv',
'TAXRATES_ZIP5_SC201903.csv',
'TAXRATES_ZIP5_SD201903.csv',
'TAXRATES_ZIP5_TN201903.csv',
'TAXRATES_ZIP5_TX201903.csv',
'TAXRATES_ZIP5_UT201903.csv',
'TAXRATES_ZIP5_VA201903.csv',
'TAXRATES_ZIP5_VT201903.csv',
'TAXRATES_ZIP5_WA201903.csv',
'TAXRATES_ZIP5_WI201903.csv',
'TAXRATES_ZIP5_WV201903.csv',
'TAXRATES_ZIP5_WY201903.csv']
len(List_fileName)
# generate a list of variable-name for 52 data frame numbered as  dfn1,dfn2,dfn3,....

l2=[]
def df_gen(s=1,n=53):        # s:starting point =1
#     globals()l2=[]
    for i in range(s,n):
        k="dfn"+str(i)
        l2.append(k)

#calling function to generate the list of variable for
df_gen()
print(l2)<jupyter_output>['dfn1', 'dfn2', 'dfn3', 'dfn4', 'dfn5', 'dfn6', 'dfn7', 'dfn8', 'dfn9', 'dfn10', 'dfn11', 'dfn12', 'dfn13', 'dfn14', 'dfn15', 'dfn16', 'dfn17', 'dfn18', 'dfn19', 'dfn20', 'dfn21', 'dfn22', 'dfn23', 'dfn24', 'dfn25', 'dfn26', 'dfn27', 'dfn28', 'dfn29', 'dfn30', 'dfn31', 'dfn32', 'dfn33', 'dfn34', 'dfn35', 'dfn36', 'dfn37', 'dfn38', 'dfn39', 'dfn40', 'dfn41', 'dfn42', 'dfn43', 'dfn44', 'dfn45', 'dfn46', 'dfn47', 'dfn48', 'dfn49', 'dfn50', 'dfn51', 'dfn52']<jupyter_text>the above list of variable name in L2 can't be used to iterate over and assign them values(like dictionary)<jupyter_code># funtion for  generating global enumerated variable from list(l2 containing varaible names for df ) and 
# assign the the elements of l2 to the generated varable

def gen_enum():
    for n, val in enumerate(l2,start=1):
        globals()["df%d"%n] = val                 # string formating used here %d would be replaced by %n 
#         print(   ["df%d"%n])                      # just for testing : we print our farmatted string 

gen_enum()
# This routine opens (one by one) a file  in directory read the csv  and loads in a pandas dataframe

count=0
f='0'
dfn="df"
# print(l1)
        
for i,v in enumerate(List_fileName,start=1):   # i is the number generated and v is corresponding element of list
    count+=1
    filename="C:/Users/Ahmed/Documents/A_DrNoman/Bid_postal/TAXRATES_ZIP5/"+v            # file name of each file will be combined with  file path  folder
    fileobj="f_obj"+str(i)                       # fileobj variable is also created coresponding every new file
    f="f"+str(i)                                 # creating a variable on each iteration
    
        
    with open(filename,"r") as fileobj:          # opening file name in read mode one by one
        l2[i-1]=pd.read_csv(fileobj)             # load the read file to coresponding data frame,
                                                 #(i-1 ) is used because indexing of elements in list starts from 0
        
    
 
    

# just for testing : we are looking at last  dataframe

l2[51].describe()
df52.info()
# concatenating or merging all dataframes

d_all=pd.concat([df1, df2, df3, df4, df5, df6, df7, df8, df9, df10, df11, df12, df13, df14, df15, df16, df17, df18, df19, df20, df21, df22, df23, df24, df25, df26, df27, df28, df29, df30, df31, df32, df33, df34, df35, df36, df37, df38, df39, df40, df41, df42, df43, df44, df45, df46, df47, df48, df49, df50, df51, df52, df1, df2, df3, df4, df5, df6, df7, df8, df9, df10, df11, df12, df13, df14, df15, df16, df17, df18, df19, df20, df21, df22, df23, df24, df25, df26, df27, df28, df29, df30, df31, df32, df33, df34, df35, df36, df37, df38, df39, df40, df41, df42, df43, df44, df45, df46, df47, df48, df49, df50, df51, df52, df1, df2, df3, df4, df5, df6, df7, df8, df9, df10, df11, df12, df13, df14, df15, df16, df17, df18, df19, df20, df21, df22, df23, df24, df25, df26, df27, df28, df29, df30, df31, df32, df33, df34, df35, df36, df37, df38, df39, df40, df41, df42, df43, df44, df45, df46, df47, df48, df49, df50, df51, df52])
d_all.to_csv('d_all.csv')
d_all.info()
# done thill here
# making names from the list

for n, val in enumerate(l1,start=1):
    globals()["var%d"%n] = val
    print(["var%d"%n],end="")

print ("\n\n\n checking  for var5 ", var5)   
print (var5)  # etc.
var52<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1425364758698092, 'fraction_numerical': 0.14665170220725776, 'mean_word_length': 4.569791666666666, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '65841', 'license': 'MIT', 'n_tokens_mistral': 2804, 'n_tokens_neox': 2338, 'n_words': 523, 'path': 'bid_postal-FInal.ipynb', 'repo_name': 'wahmed555/DataWrangle', 'size': '5346'}