python可视化:公积金与商业贷款利率历年趋势1
python可视化:公积金与商业贷款利率历年趋势1
根据最新政策(截至2025年5月12日),中国公积金贷款和商业贷款利率调整如下:
1. 公积金贷款利率(2025年5月8日起执行)
- 首套房:
- 5年以下(含5年):2.1%(下调0.25个百分点)
- 5年以上:2.6%(原2.85%,下调0.25个百分点)
- 二套房:
- 5年以下(含5年):不低于2.525%
- 5年以上:不低于3.075%
影响:以100万、30年期等额本息贷款为例,首套房公积金贷款月供从4136元降至4003元,总利息减少约4.8万元。
2. 商业贷款利率(2025年5月最新调整)
- 首套房:
- 最低利率:3.0%(部分城市如深圳可低至3.15%)
- 5年期以上LPR预计降至3.0%(此前为3.1%)
- 二套房:
- 最低利率:3.15%-3.55%(因城市和银行政策而异)
影响:若LPR降至3.0%,100万30年期商业贷款月供减少约54元,总利息节省1.9万元。
- 专家预测,若经济持续承压,公积金利率可能进一步下调至2.3%,商业贷款LPR或降至2.9%
作为房奴的一员,斑点鱼将基于2010-2025年中国公积金贷款利率和商业贷款利率变化进行Python可视化分析,结合最新政策调整(截至2025年5月)和经济背景对其进行解读。
数据准备与可视化分析
1. 数据整理
斑点鱼提取了2010-2025年的公积金和商业贷款利率数据,并整理成结构化格式:
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
from matplotlib.ticker import MultipleLocator# 设置中文显示
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False# 创建示例数据(实际数据来自央行和公积金管理中心公告)
data = {'date': pd.to_datetime(['2010-01-01', '2011-07-01', '2012-06-08', '2014-11-22', '2015-03-01', '2015-05-11', '2015-06-28', '2015-08-26','2022-01-01', '2024-05-18', '2025-01-01', '2025-05-07']),'公积金_5年以上': [4.30, 4.90, 4.50, 4.25, 4.00, 3.75, 3.50, 3.25, 3.10, 2.85, 2.85, 2.60],'商业贷款_5年以上': [5.94, 6.40, 6.00, 6.15, 5.90, 5.65, 5.40, 5.15, 4.65, 3.60, 3.30, 3.00]
}df = pd.DataFrame(data)
df.set_index('date', inplace=True)
输出:df1
2. 利率变化趋势可视化
plt.figure(figsize=(14, 8))
plt.plot(df.index, df['公积金_5年以上'], label='公积金贷款(5年以上)', marker='o', linewidth=2, color='#1f77b4')
plt.plot(df.index, df['商业贷款_5年以上'], label='商业贷款(5年以上)', marker='s', linewidth=2, color='#ff7f0e')# 标注重要政策调整点
important_dates = {'2011-07-01': '2011年加息周期\n抑制通胀','2015-08-26': '2015年多次降息\n配合去库存','2022-01-01': '2022年利率下调\n稳楼市','2024-05-18': '2024年公积金利率下调','2025-05-07': '2025年"双降"\n公积金利率降至2.6%'
}for date_str, note in important_dates.items():date = pd.to_datetime(date_str)if date in df.index:y_val = df.loc[date, '商业贷款_5年以上'] if '加息' in note else df.loc[date, '公积金_5年以上']plt.annotate(note, xy=(date, y_val),xytext=(10, 20), textcoords='offset points',arrowprops=dict(arrowstyle='->'), bbox=dict(boxstyle='round,pad=0.5', fc='yellow', alpha=0.5))# 图表美化
plt.title('中国公积金贷款与商业贷款利率变化趋势(2010-2025)', fontsize=16, pad=20)
plt.xlabel('日期', fontsize=12)
plt.ylabel('利率(%)', fontsize=12)
plt.grid(True, linestyle='--', alpha=0.7)
plt.legend(fontsize=12)# 设置x轴格式
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m'))
plt.gca().xaxis.set_major_locator(mdates.YearLocator())
plt.gcf().autofmt_xdate()plt.tight_layout()
plt.show()
图1:
3. 利率差异分析
# 计算利率差异
df['利率差'] = df['商业贷款_5年以上'] - df['公积金_5年以上']# 绘制利率差异图
plt.figure(figsize=(14, 6))
plt.bar(df.index, df['利率差'], width=100, color='#2ca02c', alpha=0.7)
plt.plot(df.index, df['利率差'], marker='o', color='#d62728', linewidth=2, markersize=8, label='利率差趋势')# 图表美化
plt.title('商业贷款与公积金贷款利率差异(2010-2025)', fontsize=16, pad=20)
plt.xlabel('日期', fontsize=12)
plt.ylabel('利率差(%)', fontsize=12)
plt.grid(True, linestyle='--', alpha=0.7, axis='y')# 设置x轴格式
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m'))
plt.gca().xaxis.set_major_locator(mdates.YearLocator())
plt.gcf().autofmt_xdate()plt.tight_layout()
plt.show()
图2:
4. 2025年最新利率影响分析
# 计算2025年最新利率下的贷款成本变化
def calculate_loan(principal, rate, years):monthly_rate = rate / 100 / 12months = years * 12monthly_payment = principal * monthly_rate * (1 + monthly_rate)**months / ((1 + monthly_rate)**months - 1)total_payment = monthly_payment * monthsreturn monthly_payment, total_payment# 2025年5月最新利率
rate_gongjijin_2025 = 2.60
rate_commercial_2025 = 3.00
principal = 1e6 # 100万元贷款
years = 30# 计算月供和总还款
gongjijin_monthly, gongjijin_total = calculate_loan(principal, rate_gongjijin_2025, years)
commercial_monthly, commercial_total = calculate_loan(principal, rate_commercial_2025, years)# 准备比较数据
comparison = pd.DataFrame({'贷款类型': ['公积金贷款2025', '商业贷款2025'],'月供(元)': [gongjijin_monthly, commercial_monthly],'总还款(万元)': [gongjijin_total/1e4, commercial_total/1e4],'利率(%)': [rate_gongjijin_2025, rate_commercial_2025]
})# 绘制比较图
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))# 月供比较
bars1 = ax1.bar(comparison['贷款类型'], comparison['月供(元)'], color=['#1f77b4', '#ff7f0e'], alpha=0.7)
ax1.set_title('100万元30年贷款月供比较(2025年)', fontsize=14)
ax1.set_ylabel('月供(元)', fontsize=12)
ax1.grid(True, linestyle='--', alpha=0.7, axis='y')# 在柱子上添加数值
for bar in bars1:height = bar.get_height()ax1.annotate(f'{height:.0f}',xy=(bar.get_x() + bar.get_width() / 2, height),xytext=(0, 3), textcoords='offset points',ha='center', va='bottom')# 总还款比较
bars2 = ax2.bar(comparison['贷款类型'], comparison['总还款(万元)'], color=['#1f77b4', '#ff7f0e'], alpha=0.7)
ax2.set_title('100万元30年贷款总还款比较(2025年)', fontsize=14)
ax2.set_ylabel('总还款(万元)', fontsize=12)
ax2.grid(True, linestyle='--', alpha=0.7, axis='y')# 在柱子上添加数值
for bar in bars2:height = bar.get_height()ax2.annotate(f'{height:.1f}',xy=(bar.get_x() + bar.get_width() / 2, height),xytext=(0, 3), textcoords='offset points',ha='center', va='bottom')plt.tight_layout()
plt.show()
图3:
经济含义与政策效果分析
1. 利率变化的宏观经济背景
- 2011年加息:为抑制通胀和房地产过热,央行提高了贷款利率。
- 2015年多次降息:配合房地产去库存政策,一年内公积金利率从4.0%降至3.25%。
- 2022年利率下调:应对经济下行压力,首套房公积金利率降至3.1%。
- 2024-2025年"双降":公积金利率从2.85%降至2.6%,商业贷款LPR预计降至3.0%,旨在"推动房地产市场止跌回稳"。
2. 公积金与商业贷款的差异
- 利率差缩小但仍存在:2025年商业贷款利率(3.0%)比公积金(2.6%)高0.4个百分点,较2011年的1.5个百分点大幅收窄。
- 政策导向明显:公积金调整幅度通常小于商业贷款,体现政策性住房金融特点。
- 购房成本显著下降:2025年相比2011年,公积金贷款月供下降约47%,商业贷款下降约53%。
3. 最新政策效果(2025年5月)
- 直接减负:100万30年公积金贷款月供减少133元,总利息节省4.8万元。
- 组合拳效应:与降准0.5个百分点(释放1万亿流动性)形成政策协同,预计全年减少利息支出超千亿元。
- 市场预期管理:通过"量增、价降"强化对房地产等重点领域的支持。
4. 潜在影响与争议
- 利率倒挂风险:2024年曾出现部分城市商贷利率(2.6%)低于公积金(2.85%)的情况,引发对公积金制度有效性的讨论。
- 普惠性挑战:公积金贷款额度限制和审批流程复杂,在利率差缩小背景下吸引力下降。
- 改革方向:专家建议公积金利率应更灵活调整,保持与商贷1个百分点左右的利差。
结论
通过Python可视化分析可见:
- 中国房贷利率呈现明显政策周期,2015年和2022年后进入下行通道,2025年达历史低位。
- 公积金贷款始终维持利率优势,但利差缩小引发制度优化讨论。
- 最新"双降"政策通过降低购房成本、释放流动性双管齐下,是"超常规逆周期调节"的具体落实。
- 未来利率走势将取决于房地产市场复苏情况和CPI变化,预计仍有下调空间。