www.e-stat.go.jp exploratory.io import pandas as pd df1 = pd.read_excel( "https://www.e-stat.go.jp/stat-search/file-download?statInfId=000031577984&fileKind=0", header=None, ) df1.to_csv("data.tsv", sep="\t") # 行カウント確認 df1.notnull().sum(axis=0) # 列カウント確認 df1.notnull().sum(axis=1) df1 # テキスト埋め df1.iat[7, 7] = "男女" df1.iat[7, 10] = "年齢" df1.iat[7, 12] = df1.iat[6, 12] df1.iat[7, 13] = df1.iat[6, 13]