<jupyter_start><jupyter_text>4.2.1 各年度別の業種ごとの企業数全 2360 件の業種ごとの企業数に関する図は図表 5 の通りである。なお、前述した通り企業数及びその種類は、コロナ前、コロナ過渡期、コロナ後すべて統一している。<jupyter_code>import pandas as pd

def make_type_of_industry_list(data_frame : pd.DataFrame, industry_col="[業種（東証）]"):
    return list(set(data_frame[industry_col]))

def make_type_of_industry_list(data_frame : pd.DataFrame, industry_col="[業種（東証）]"):
    return list(set(data_frame[industry_col]))

#renketsuだと業種の種類を網羅できるため指定
data_frame_name ="renketsu" 
data_frame = pd.read_csv("/home/jovyan/1CalliingEdinetApi"+f"/EdinetIdxFiles/edinet_{data_frame_name}.csv", skiprows=4)
import pandas as pd
import glob

industry_list = make_type_of_industry_list(data_frame)

sum_len = 0
enterprise_length_li =  []
for industry_spec in industry_list:
    enterprise_length = len(glob.glob(f'/home/jovyan/3FetchingMDandA' + f"/**/{industry_spec}/BeforeSample/*.csv", recursive=True))
    enterprise_length_li.append(enterprise_length)
    
enterprise_length_li.append(sum(enterprise_length_li))
industry_list.append("合計")

sum_val = enterprise_length_li[-1]
composition_li = [ f"{round(e / sum_val * 100, 2)}%" for e in  enterprise_length_li]
df= pd.DataFrame(
    {
       "企業数":  enterprise_length_li,
        "構成比":  composition_li,
    }, index= industry_list
)

df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12091254752851711, 'fraction_numerical': 0.012927756653992395, 'mean_word_length': 6.833333333333333, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '528429', 'license': 'MIT', 'n_tokens_mistral': 594, 'n_tokens_neox': 595, 'n_words': 69, 'path': 'src/4AnalysingText/composition_of_industries_in_the_sample.ipynb', 'repo_name': 'Densuke-fitness/MDandAAnalysisFlow', 'size': '1315'}