<jupyter_start><jupyter_text>Importing os library<jupyter_code>import os
dir_dict = {0:{'Folder':None,'SubFolder':None,'File':None,'Size':None}}
            
count = 0

for folders, subfolders, filenames in os.walk('/Users/aliraza/Documents/Semester 4'):
    dir_dict[count]['Folder'] = folders
    
    
    for subfolder in subfolders:
        dir_dict[count]['SubFolder'] = subfolder
    
    for file in filenames:
        dir_dict[count]['File'] = file
        dir_dict[count]['Size'] = os.stat(folders+'/'+file)
        dir_dict[count]['Size'] = dir_dict[count]['Size'].st_size
    count = count + 1
    dir_dict[count] = {}
        
#     print("\n")<jupyter_output><empty_output><jupyter_text>Dictionary  Output<jupyter_code>dir_dict<jupyter_output><empty_output><jupyter_text>Importing pandas to convert dictionary to dataframe<jupyter_code>import pandas as pd<jupyter_output><empty_output><jupyter_text>Converting dictionary to dataframe and sorting it<jupyter_code>my_files = pd.DataFrame(dir_dict).transpose()

my_files = my_files.sort_values('Size',ascending=False)
my_files.drop(58,inplace = True)<jupyter_output><empty_output><jupyter_text>Sorted Output:<jupyter_code>print("Here NaN in column value means the we are still in the same previously occured folder")
display(my_files)<jupyter_output>Here NaN in column value means the we are still in the same previously occured folder<jupyter_text>Output with reset_index to make it look more better<jupyter_code>display(my_files.reset_index(drop=True))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11650485436893204, 'fraction_numerical': 0.003883495145631068, 'mean_word_length': 5.901785714285714, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '530233', 'license': 'Unlicense', 'n_tokens_mistral': 533, 'n_tokens_neox': 517, 'n_words': 99, 'path': 'Week2/Week2_Task1.ipynb', 'repo_name': 'Ali-Raza-Ali/PythonBootCamp_DHA_SUFA_Assignments', 'size': '1545'}