At the same time, I also visualized the tax reduction when purchasing my home. https://www.nta.go.jp/taxanswer/sozoku/4508.htm
https://www.nta.go.jp/taxanswer/zoyo/4408.htm
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def before_offset(x):
return 110
def before_offset_home(x):
return 110 + 1200
def after_offset(x):
offset = 0
if x <= 200: offset = 0
elif x <= 400: offset = 10
elif x <= 600: offset = 30
elif x <= 1000: offset = 90
elif x <= 1500: offset = 190
elif x <= 3000 : offset = 265
elif x <= 4500 : offset = 415
elif x > 4500: offset = 640
return offset
def ratio(x):
r = 0.0
if x <= 200: r = 0.1
elif x <= 400: r = 0.15
elif x <= 600: r = 0.2
elif x <= 1000: r = 0.3
elif x <= 1500: r = 0.4
elif x <= 3000 : r = 0.45
elif x <= 4500 : r = 0.5
elif x > 4500 : r = 0.55
return r
def tax(x):
before_muliply = x - before_offset(x)
if before_muliply < 0 : return 0
after_multiply = before_muliply * ratio(before_muliply)
return after_multiply - after_offset(before_muliply)
def tax_home(x):
before_muliply = x - before_offset_home(x)
if before_muliply < 0 : return 0
after_multiply = before_muliply * ratio(before_muliply)
return after_multiply - after_offset(before_muliply)
v_tax = np.vectorize(tax)
v_tax_home = np.vectorize(tax_home)
x = np.linspace(0, 5000, 5001)
y = v_tax(x)
y_home = v_tax_home(x)
fig, ax = plt.subplots()
ax.plot(x,y, color='blue', label='normal')
ax.plot(x,y_home, color='green', label='home')
ax.legend()
ax.set_xlabel('given')
ax.set_ylabel('tax')
I wonder if the officials are doing their best in Excel.
I was skeptical about income tax, gift tax, and discretized taxes. It turned out that it was Piecewise linear, and it turned out that it was easy to understand.
Recommended Posts