目录
一,前言:
新能源汽车行业涉及大量数据,包括销售数据、充电设施数据、车辆性能数据等。利用Python进行数据分析和可视化可以帮助企业更好地理解市场趋势、用户需求和产品表现,为决策提供有力支持。
Python可以编写自动化脚本,从不同数据源获取数据并生成报告,节省人力和时间成本。这对于需要定期生成报告的企业来说尤其重要,可以保持报告的及时性和准确性。
新能源汽车行业处于快速发展阶段,技术和创新是竞争的关键。利用Python进行报告生成不仅能提高工作效率,还可以通过引入新的分析方法和工具不断优化报告内容和质量,保持企业在行业中的竞争优势。
二,报告的效果展示
车辆状态
三,python生成pdf报告的实现过程
1,清洗can信号数据
#整车零部件状态
df2 = pd.DataFrame()
df2['DPB激活'] = np.where(df_func['IDB7_DynParkBrkByIDBActive'.lower()] == 1, 1, 0)
df2['ABS激活'] = np.where(df_func['IDB7_ABSActive'.lower()] == 1, 1, 0)
df2['TCS激活'] = np.where(df_func['IDB7_TCSActive'.lower()] == 1, 1, 0)
df2['ESC激活'] = np.where(df_func['IDB7_ESCActive'.lower()] == 1, 1, 0)
df2['ARP激活'] = np.where(df_func['IDB7_ROPACTIVE'.lower()] == 1, 1, 0)
print("================22222========================")
# df2['AVH激活'] = np.where(df_func['IDB7_AVHStatus'.lower()] == 1, 1, 0)
print("================3333========================")
df2['EPB激活'] = np.where(df_func['IDB6_EPBStatus'.lower()].isin([2, 3, 4, 5]), 1, 0)
print("================4444========================")
df2['HDC激活'] = np.where(df_func['IDB7_HDCAtive'.lower()] == 1, 1, 0)
print("================22222========================")
df2['ABS故障'] = np.where(df_func['IDB7_ABSFail'.lower()] == 1, 1, 0)
df2['EBD故障'] = np.where(df_func['IDB7_EBD_Fail'.lower()] == 1, 1, 0)
df2['TCS故障'] = np.where(df_func['IDB7_TCSFail'.lower()] == 1, 1, 0)
df2['ESC故障'] = np.where(df_func['IDB7_ESCFail'.lower()] == 1, 1, 0)
df2['ARP故障'] = np.where(df_func['IDB7_ROPFailure'.lower()] == 1, 1, 0)
print("================22222========================")
df2['ESC处于关闭状态'] = np.where(df_func['IDB7_TCSDisable'.lower()] == 1, 1, 0)