Python:外車が全く売れない日本の歪な輸入車市場を考察してみる

このサイトを参考にして、日本の自動車の輸出入を考察してみようと思う。日本にとって自動車は唯一無二の輸出財であるが、輸入自動車については、ドイツが圧倒していることは容易に想像できる。

スポンサーリンク

日本の輸入自動車事情

このサイトからデータをダウンロードしてくる。

import pandas as pd
pd.set_option('display.max_columns', None)
df = pd.read_csv('comtrade.csv')
df.head()
Classification Year Period Period Desc. Aggregate Level Is Leaf Code Trade Flow Code Trade Flow Reporter Code Reporter Reporter ISO Partner Code Partner Partner ISO 2nd Partner Code 2nd Partner 2nd Partner ISO Customs Proc. Code Customs Mode of Transport Code Mode of Transport Commodity Code Commodity Qty Unit Code Qty Unit Qty Alt Qty Unit Code Alt Qty Unit Alt Qty Netweight (kg) Gross weight (kg) Trade Value (US$) CIF Trade Value (US$) FOB Trade Value (US$) Flag
0 HS 2018 201808 August 2018 4 0 2 Exports 392 Japan NaN 56 Belgium NaN NaN NaN NaN NaN NaN NaN NaN 8702 Vehicles; public transport passenger type NaN NaN NaN NaN NaN NaN 9954.0 NaN 127996 NaN NaN 0
1 HS 2018 201808 August 2018 4 0 2 Exports 392 Japan NaN 60 Bermuda NaN NaN NaN NaN NaN NaN NaN NaN 8702 Vehicles; public transport passenger type NaN NaN NaN NaN NaN NaN 9844.0 NaN 136163 NaN NaN 0
2 HS 2018 201808 August 2018 4 0 2 Exports 392 Japan NaN 116 Cambodia NaN NaN NaN NaN NaN NaN NaN NaN 8702 Vehicles; public transport passenger type NaN NaN NaN NaN NaN NaN 14769.0 NaN 189918 NaN NaN 0
3 HS 2018 201808 August 2018 4 0 2 Exports 392 Japan NaN 196 Cyprus NaN NaN NaN NaN NaN NaN NaN NaN 8702 Vehicles; public transport passenger type NaN NaN NaN NaN NaN NaN 2491.0 NaN 32028 NaN NaN 0
4 HS 2018 201808 August 2018 4 0 2 Exports 392 Japan NaN 136 Cayman Isds NaN NaN NaN NaN NaN NaN NaN NaN 8702 Vehicles; public transport passenger type NaN NaN NaN NaN NaN NaN 1702.0 NaN 21889 NaN NaN 0
COLUMNS = ['Year', 'Period','Trade Flow','Reporter', 'Partner', 'Commodity','Commodity Code','Trade Value (US$)']
df = df[COLUMNS]
df_world = df[df['Partner'] == 'World']
df_countries = df[df['Partner'] != 'World']
df_imports = df[df['Trade Flow'] == 'Imports']
df_countries_imports = df_countries[df_countries['Trade Flow'] == 'Imports']
df_world_imports=df_world[df_world['Trade Flow'] == 'Imports']
ImportsInJanuary2018 = df_countries_imports[df_countries_imports['Period'] == 201801]
ImportsInJanuary2018.sort_values('Trade Value (US$)',ascending=False).head(10)
Year Period Trade Flow Reporter Partner Commodity Commodity Code Trade Value (US$)
3544 2018 201801 Imports Japan Germany Motor cars and other motor vehicles; principal… 8703 470314545
3541 2018 201801 Imports Japan United States of America Motor cars and other motor vehicles; principal… 8703 83747141
3557 2018 201801 Imports Japan United Kingdom Motor cars and other motor vehicles; principal… 8703 77381975
3564 2018 201801 Imports Japan South Africa Motor cars and other motor vehicles; principal… 8703 48164713
3543 2018 201801 Imports Japan Italy Motor cars and other motor vehicles; principal… 8703 48131005
3551 2018 201801 Imports Japan Belgium Motor cars and other motor vehicles; principal… 8703 32172085
3545 2018 201801 Imports Japan France Motor cars and other motor vehicles; principal… 8703 30029010
3546 2018 201801 Imports Japan Hungary Motor cars and other motor vehicles; principal… 8703 29322882
3572 2018 201801 Imports Japan Mexico Motor cars and other motor vehicles; principal… 8703 16582511
3563 2018 201801 Imports Japan Spain Motor cars and other motor vehicles; principal… 8703 16541355

ドイツが圧倒的に強い。あまりにも強過ぎる。どれくらい強いのかと言うと、下を見れば一目瞭然だろう。

a = ImportsInJanuary2018.sort_values('Trade Value (US$)',ascending=False)
sum(a['Trade Value (US$)'][1:])
454767020

2018年1月の数字では、ドイツ以外の全ての輸入車を足してもドイツ一国に及ばない。輸入相手国に南アフリカやメキシコがあるのは、例えば、日本の自動車企業がその国から日本に逆輸入しているということである。

データのグループ化

groups = df_countries.groupby('Trade Flow')
groups.get_group('Imports').head()
Year Period Trade Flow Reporter Partner Commodity Commodity Code Trade Value (US$)
134 2018 201808 Imports Japan Philippines Vehicles; public transport passenger type 8702 171180
135 2018 201808 Imports Japan United States of America Vehicles; public transport passenger type 8702 8662
136 2018 201808 Imports Japan China Vehicles; public transport passenger type 8702 28841
338 2018 201809 Imports Japan Australia Vehicles; public transport passenger type 8702 2565038
339 2018 201809 Imports Japan France Vehicles; public transport passenger type 8702 288709
GROUPING_COMMFLOW = ['Commodity Code','Trade Flow']

groups = df_countries.groupby(GROUPING_COMMFLOW)
groups.groups.keys()
dict_keys([(8702, 'Exports'), (8702, 'Imports'), (8703, 'Exports'), (8703, 'Imports')])
groups = df_countries.groupby('Commodity Code')
groups.get_group(8703).sort_values("Trade Value (US$)", ascending=False).head()
Year Period Trade Flow Reporter Partner Commodity Commodity Code Trade Value (US$)
3539 2018 201811 Exports Japan United States of America Motor cars and other motor vehicles; principal… 8703 3877304496
2255 2018 201802 Exports Japan United States of America Motor cars and other motor vehicles; principal… 8703 3737613322
3328 2018 201810 Exports Japan United States of America Motor cars and other motor vehicles; principal… 8703 3622257927
2686 2018 201804 Exports Japan United States of America Motor cars and other motor vehicles; principal… 8703 3575398739
2293 2018 201803 Exports Japan United States of America Motor cars and other motor vehicles; principal… 8703 3533440519
df_world_imports.groupby('Commodity Code')['Trade Value (US$)'].aggregate(sum)
Commodity Code
8702       25236364
8703    11176599399
Name: Trade Value (US$), dtype: int64

2018年の自動車輸入額は約112億ドル(1兆2475億円)、本当かどうかは知らん。

df_countries_imports_totals=df_countries_imports.groupby('Partner')[['Trade Value (US$)']].aggregate(sum)
df_countries_imports_totals.sort_values('Trade Value (US$)', ascending=False).head()
Trade Value (US$)
Partner
Germany 5672621398
United Kingdom 1266965764
United States of America 817499460
Italy 598526198
South Africa 546386075

ドイツが日本の自動車輸入額の半分以上を占めている。

日本の自動車輸入国をグラフ化

先ず、ドルを円に変換する。

a = df[df["Trade Flow"]=='Imports'].groupby(['Partner'])['Trade Value (US$)'].aggregate(sum)
for i in range(len(a)):
    a[i] = a[i]*111
from matplotlib.pyplot import *
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
import matplotlib.patches as mpatches
style.use('ggplot')

rcParams["font.size"] = "18"
fp = FontProperties(fname='/usr/share/fonts/opentype/ipaexfont-gothic/ipaexg.ttf', size=54)
rcParams['font.family'] = fp.get_name()
rcParams["font.size"] = "17"
fig, ax = subplots(figsize=(20,12))
a.sort_values(ascending=False, inplace=False).plot(kind='barh')
xticks(np.arange(0,14e11,1e11),
  ['{}兆'.format(float(x/1e12)) if x > 0 else 0 for x in np.arange(0,14e11,1e11)])
ax.set_xlabel('自動車輸入額 (円)');
rcParams["font.size"] = "17"
fig, ax = subplots(figsize=(20,12))

a[:-1].sort_values(ascending=False, inplace=False).plot(kind='barh')
xticks(np.arange(0,7e11,1e11),
  ['{}兆'.format(float(x/1e12)) if x > 0 else 0 for x in np.arange(0,7e11,1e11)])
ax.set_xlabel('自動車輸入額 (円)');

ドイツ一強状態になっているのが日本の輸入自動車市場の実態のようである。そのドイツ車にしても年6000億円程度しか売れていない。日本は輸入車市場としては全く魅力の無い国となってしまっている。トランプ大統領が日本にアメ車を買えと言ってもどだい無理な話である。