This problem can be solved by using different variable names in the loop. However, I need to check whether we can find the length of elements of List which can store data frames.
I have written code to read all .csv file stored in a folder. I have created the list containing the characters. Now, I am reading one by one csv files from a folder and storing as data frames in elements of list. Hence, all Elements of list contain data frame which is obtained by reading csv files. I.e., List element 0 - "a" contain one data frame, List element 1 - "b" contain other data frames and so on. I need to find the length of Data frames contained by elements of the list. I am using len(), but this reflects the only length of the list. Kindly suggest me some solution.
Below mentioned is the code.
url = "C:/Users/SONY/Desktop/SEdge/Proec/Day/Master Files/20-12-2017/"
count = 0;
lst = ["a", "b", "c", "d"]
os.chdir(url)
for file in glob.glob("*.csv"):
join = url + file;
lst[count] = pd.read_csv(join)
count +=1;
print(len(lst[1]))