CPUの性能と職業別労働者数の関係を調べた
下準備 processor.csvはその年の最高性能のものを抽出 import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import statsmodels.api as sm #CPU性能と職業別労働者数をデータフレームする p_df = pd.read_csv('data/input/processor.csv') p_df = p_df.groupby('year', group_keys=False).apply(lambda x: x.loc[x['MOS transistor count'].idxmax()]) w_df = pd.read_csv('data/input/worker2.csv') #マージする p_df.reset_index(drop = True, inplace = True) w_df.reset_index(drop = True, inplace = True) df = pd.merge(w_df, p_df, on="year", how="left") #目的変数のリスト objective_vars = ['agriculture', 'fisheries', 'mining', 'construction', 'manifacture', 'infrastructure', 'infomation', 'transport', 'retail', 'finance', 'real-estate', 'research', 'accommodations-service','personal-service', 'education', 'medical','compound','etc','gov'] 複合グラフの作成 折れ線グラフが目的変数、棒グラフが説明変数...