#16 単一産業における投入分、産出分、燃料使用分を計算/Calculating Input, Output, and Fuel Consumption for a Single Industry
An English translation of this article is provided at the bottom of the page.
今回は、一つの産業にしぼって、その産業に投入される物質量(投入量)を計算するプログラムを書くことに挑戦します。ここでは、分類コード:0111(分類名:穀類)に産業を固定し、投入分、産出分、燃料使用分のそれぞれを算出するコードを書いてみました。ちなみに、df_price_per_tonは重量単価一覧表を、df_iotableは産業連関表をそれぞれデータフレーム形式に格納したものになります。
# x産業を0111(穀類)に固定
x = 0
# 投入量を計算
input = 0 # 投入分
fuel = 0 # 燃料使用分
for i in range(187):
for k in range(len(df_price_per_ton.index)):
if df_price_per_ton.iloc[k][0] == 0:
continue
if df_price_per_ton.index[k] == df_iotable.index[i]:
input += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0]
# 燃料使用分を計算
if df_price_per_ton.index[k] == '2121': # 石炭製品の燃料使用分
fuel += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0]
# 石油化学系基礎製品への石油製品の投入ではない場合
if df_price_per_ton.index[k] == '2111':
if df_iotable.columns[x] != '2031':
fuel += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0] # 石油製品の燃料使用分
print('投入分:' + str(int(input)) + '[t]')
print('燃料使用分:' + str(int(fuel)) + '[t]')
# 産出量を計算
output = 0 # 産出分
for i in range(187):
if i == x:
continue
output += df_iotable.iloc[x][i] * 1000000 / df_price_per_ton.iloc[x][0]
print('産出分:' + str(int(output)) + '[t]')
waste = input - output - fuel
print('廃棄物発生量:' + str(int(waste)) + '[t]')

投入分の計算
投入分として、産業連関表を列(縦)方向に見る必要があります。今回は、列0111を見て、各産業ごとの投入金額を各産業の重量単価で割ったものを加算していきます。
列0111(穀類)に投入がある産業の一部を表にすると、下図のようになります。

燃料使用分の計算
投入がある産業のうち、石炭製品・石油製品については、燃料として使用され、炭酸ガスとして放出されると考えます。なので、燃料使用分も別途計上します。
上図だと、石油製品の投入(金額:49百万円)が燃料として使用されたと考えます。
ただし、石油製品の石油化学基礎製品への投入は、燃料としてではなく原材料として投入されたとみなします。
産出分の計算
今度は、産業連関表を行(横)方向に見ます。行0111(穀類)を見て、各産業への産出金額を、0111(穀類)の重量単価で割ったものを加算していきます。
行0111の産出先の部門名・金額・重量単価・重量を列挙し、重量の合計(産出分)を求めたものが、下図になります。

同一産業(0111から0111)への産出は、産出分には含めていません。投入分に含まれています。
English translation part is here.
In this post, I will take a look at a single industry and attempt to write a program that calculates the physical amount of materials (input amount) flowing into that industry. Specifically, I have fixed the target to industry code 0111 (Grains) and written code to calculate the respective amounts for input, output, and fuel consumption. For reference, df_price_per_ton contains the price-per-weight table, and df_iotable contains the Input-Output (I-O) table, both stored as dataframes.
# Fix industry x to 0111 (Grains)
x = 0
Calculate Input Amount
input_total = 0 # Total Input
fuel = 0 # Fuel Consumption
for i in range(187):
for k in range(len(df_price_per_ton.index)):
if df_price_per_ton.iloc[k][0] == 0:
continue
if df_price_per_ton.index[k] == df_iotable.index[i]:
input_total += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0]
# Calculate Fuel Consumption
if df_price_per_ton.index[k] == '2121': # Fuel use of coal products
fuel += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0]
# If the petroleum product is NOT an input for basic petrochemical products
if df_price_per_ton.index[k] == '2111':
if df_iotable.columns[x] != '2031':
fuel += df_iotable.iloc[i][x] * 1000000 / df_price_per_ton.iloc[k][0] # Fuel use of petroleum products
print('Input Total: ' + str(int(input_total)) + ' [t]')
print('Fuel Consumption: ' + str(int(fuel)) + ' [t]')
Calculate Output Amount
output_total = 0 # Total Output
for i in range(187):
if i == x:
continue
output_total += df_iotable.iloc[x][i] * 1000000 / df_price_per_ton.iloc[x][0]
print('Output Total: ' + str(int(output_total)) + ' [t]')
waste = input_total - output_total - fuel
print('Waste Generation: ' + str(int(waste)) + ' [t]')

Calculating Input Amount
To determine the input amount, we need to examine the Input-Output table column-wise (vertically). In this case, we look at column 0111 and add up the input values from each industry divided by their respective price-per-weight unit.
The table below shows a portion of the industries providing input to column 0111 (Grains).

Calculating Fuel Consumption
Among the input industries, coal and petroleum products are considered to be consumed as fuel and released as CO2. Therefore, fuel consumption is calculated separately.
In the figure above, for example, the input of petroleum products (Value: 49 million yen) is treated as fuel consumption.
However, petroleum products used for basic petrochemical products are treated as raw material inputs rather than fuel.
Calculating Output Amount
Next, we examine the Input-Output table row-wise (horizontally). We look at row 0111 (Grains) and sum up the output values to various industries, divided by the price-per-weight of 0111.
The figure below lists the destination sectors, values, unit prices, and weights for row 0111, calculating the total weight (output amount).

Note that outputs within the same industry (0111 to 0111) are not included in the output amount, as they are already accounted for in the input amount.


