<%@include file=“city.txt“%>中文乱码

jsp报错

1)<%@include file=“city.txt”%>中文乱码

JSP要经过两次的“编码”,第一阶段会用pageEncoding
,第二阶段会用utf-8至utf-8,第三阶段就是在客户端浏览器里看到的网页, 用的是contentType。

第一阶段是jsp编译成.java,它会根据pageEncoding的设定读取jsp,结果是由指定的编码方案翻译成统一的UTF-8 JAVA源码(即.java),如果pageEncoding设定错了,或没有设定,出来的就是中文乱码。

第二阶段是由JAVAC的JAVA源码至java byteCode的编译,不论JSP编写时候用的是什么编码方案,经过这个阶段的结果全部是UTF-8的encoding的java源码。

JAVAC用UTF-8的encoding读取java源码,编译成UTF-8 encoding的二进制码(即.class),这是JVM对常数字串在二进制码(java encoding)内表达的规范。

第三阶段是Tomcat(或其的application container)载入和执行阶段二的来的JAVA二进制码,输出的结果,也就是在客户端见到的,这时隐藏在阶段一和阶段二的参数contentType就发挥了功效

而include指令就是在第一阶段之前执行的,注意这个是在第一阶段之前,所以,如果包含文件和被包含文件的文件编码不是utf-8,那么,该指令就会工作不太正常,不能正确的把被包含的文件从原来编码转换为包含文件的编码,就会出现乱码现象.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/WEB-INF/tags/inc.jsp"%> <html xmlns="http://www.w3.org/1899/xhtml"> <head> <base href="${ctx }/"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="X-UA-Compatible" content="IE=8"></meta> <title>指标快报</title> <%@ include file="/WEB-INF/tags/css.jsp"%> <%@ include file="/WEB-INF/tags/script.jsp"%> <%@ include file="/WEB-INF/tags/artDialog.jsp"%> <script src="static/echarts2/echarts.js"></script> </head> <body style="margin: 0.5%;"> <form id="form" method="POST"> <div class="impaction"> <div class="quota" id="quotatop"> <!-- 条件选择部分 --> <div class="com-up"> <div class="data-source">截止日期:${statdate}</div> <div class="data-source"> 二级机构: <select id="sel_company"> <c:if test="${fn:length(deptid)==2}"> <option value="00">所有机构</option> <c:forEach var="companylist" items="${companylist}"> <option value="${companylist.prvnccode}">${companylist.prvncname}</option> </c:forEach> </c:if> <c:if test="${fn:length(deptid)==10}"> <c:forEach var="companylist" items="${companylist}"> <option value="${companylist.prvnccode}">${companylist.prvncname}</option> </c:forEach> </c:if> <c:if test="${fn:length(deptid)!=2&&fn:length(deptid)!=10}"> <c:forEach var="companylist" items="${companylist}"> <c:if test="${fn:substring(deptid,0,4)==companylist.prvnccode}"> <option value="${companylist.prvnccode}">${companylist.prvncname}</option> </c:if> </c:forEach> </c:if> </select> </div> <div class="data-source"> 三级机构: <select id="sel_company2"> <option value="00">所有机构</option> <c:forEach var="companylist2" items="${companylist2}"> <option value="${companylist2.citycode}">${companylist2.cityname}</option> </c:forEach> </select> </div> <div class="data-source"> 四级机构: <select id="sel_company3"> <option value="00">所有机构</option> <c:forEach var="companylist3" items="${companylist3}"> <option value="${companylist3.countycode}">${companylist2.countyname}</option> </c:forEach> </select> </div> <div class="data-source"> 渠道: <select id="sel_channel"> <option value="00">所有渠道</option> <c:forEach var="channelist" items="${channelist}"> <option value="${channelist.codecode}">${channelist.codename}</option> </c:forEach> </select> </div> <div class="data-source"> 险类: <select id="sel_class"> <option value="00">所有险类</option> <c:forEach var="classlist" items="${classlist}"> <option value="${classlist.classCode}">${classlist.className}</option> </c:forEach> </select> </div> <div class="data-source"> 业务来源: <select id="sel_bus"> <option value="00">所有来源</option> <c:forEach var="buslist" items="${buslist}"> <option value="${buslist.busssourcecode1}">${buslist.busssourcename1}</option> </c:forEach> </select> </div> <div class="data-source"> 二级: <select id="sel_bus2"> <option value="00">所有来源</option> <c:forEach var="buslist2" items="${buslist2}"> <option value="${buslist2.busssourcecode2}">${buslist2.busssourcename2}</option> </c:forEach> </select> </div> </div> <!-- 同比部分 --> <div class="status"> <ul> <li> <div class="uup" title="核保、起保(核批、生效)日期大者在统计期内我方份额去税的保费之和">保费收入(当年)</div> <div class="ddw"> <span id="top_sumpremium_year" class="number">0.00万</span> <p id="top_sumpremium_yoy" class="word"> 同比<br>- </p> <span id="top_sumpremium_pic" class="cartoon cartoon-up"></span> </div> </li> <li> <div class="uup" title="核保(核批)通过时间在统计期内我方份额去税的保费之和">签单保费(当年)</div> <div class="ddw"> <span id="top_signpremlst_year" class="number">0.00万</span> <p id="top_signpremlst_yoy" class="word"> 同比<br>- </p> <span id="top_signpremlst_pic" class="cartoon cartoon-up"></span> </div> </li> <li> <div class="uup" title="计算时的保费和赔款均来自相同的保单,而且承担的风险也通过1/365法分摊到每一天,未起保的保费作为未到期责任准备金处理">保单年度满期赔付率 </div> <div class="ddw"> <span id="top_bdndmqpfl" class="number">0.00%</span> <p id="top_bdndmqpfl_yoy" class="word"> 同比<br>- </p> <span id="top_bdndmqpfl_pic" class="cartoon cartoon-down"></span> </div> </li> <li style="margin-right: 0;"> <div class="uup" title="统计期内所有已决赔款及新增未决赔款与所有保单(包括统计期内起保或统计期间前起保的保单)在统计期内生成的满期保费的比值">历年制赔付率</div> <div class="ddw"> <span id="top_lnzpfl" class="number">0.00%</span> <p id="top_lnzpfl_yoy" class="word"> 同比<br>- </p> <span id="top_lnzpfl_pic" class="cartoon cartoon-down"></span> </div> </li> </li> </ul> </div> </div> <!-- 仪表盘 --> <div class="dashbord"> <!-- 月日保费 --> <div class="quota" style="width: 50%; float: left;"> <!-- 同比部分 --> <div class="status"> <ul style="margin-top: 10px;"> <li style="width: 46%; margin-right: 4.8%;"> <div class="uup" title="核保、起保(核批、生效)日期大者在统计期内我方份额去税的保费之和">保费收入(当月)</div> <div class="ddw"> <span id="top_sumpremium_month" class="number">0.00万</span> </div> </li> <li style="width: 46%;"> <div class="uup" title="核保(核批)通过时间在统计期内我方份额去税的保费之和">签单保费(当月)</div> <div class="ddw"> <span id="top_signpremlst_month" class="number">0.00万</span> </div> </li> </ul> <ul style="margin-top: 20px;"> <li style="width: 46%; margin-right: 4.8%;"> <div class="uup" title="核保、起保(核批、生效)日期大者在统计期内我方份额去税的保费之和">保费收入(当日)</div> <div class="ddw"> <span id="top_sumpremium_day" class="number">0.00万</span> </div> </li> <li style="width: 46%;"> <div class="uup" title="核保(核批)通过时间在统计期内我方份额去税的保费之和">签单保费(当日)</div> <div class="ddw"> <span id="top_signpremlst_day" class="number">0.00万</span> </div> </li> </ul> </div> </div> <div id="chart13" style="width: 50%; height: 250px; float: right;"></div> </div> <!-- 折线图部分 --> <div class="chart_trend"> <div id="chart3" style="height: 250px; width: 90%; float: left;"></div> <div class="data-source" style="margin: 0.5%; float: right;"> 类型: <select id="sel_echart3" style="width: 40px;"> <option value="00">月</option> <option value="01">周</option> </select> </div> </div> </div> </form> <script type="text/javascript"> $('#locSpan',window.parent.document).html("${dq}"); var chart13, chart3; //保费收入 var top_sumpremium_daystr = document.getElementById("top_sumpremium_day");//保费收入当日 var top_sumpremium_monthstr = document.getElementById("top_sumpremium_month");//保费收入当月 var top_sumpremium_yearstr = document.getElementById("top_sumpremium_year");//保费收入当年 var top_sumpremium_yoystr = document.getElementById("top_sumpremium_yoy");//保费收入同比 //签单保费 var top_signpremlst_daystr = document.getElementById("top_signpremlst_day");//签单保费当日 var top_signpremlst_monthstr = document.getElementById("top_signpremlst_month");//签单保费当月 var top_signpremlst_yearstr = document.getElementById("top_signpremlst_year");//签单保费当年 var top_signpremlst_yoystr = document.getElementById("top_signpremlst_yoy");//签单保费同比 //满期赔付率 var top_bdndmqpfl = document.getElementById("top_bdndmqpfl"); var top_bdndmqpfl_yoystr = document.getElementById("top_bdndmqpfl_yoy"); //历年制赔付率 var top_lnzpfl = document.getElementById("top_lnzpfl"); var top_lnzpfl_yoystr = document.getElementById("top_lnzpfl_yoy"); require.config({ paths: { echarts: '${ctx}/static/echarts2' } }); require( [ 'echarts', 'echarts/chart/bar', 'echarts/chart/line', 'echarts/chart/gauge' ], function (ec) { chart13 = ec.init(document.getElementById('chart13')); chart3 = ec.init(document.getElementById('chart3')); if("${deptid}".length<=4){ refreshChart13("${deptid}"); refreshChart3("${deptid}"); }else if("${deptid}".length==6){ refreshChart13("","${deptid}"); refreshChart3("","${deptid}"); } } ); </script> <script type="text/javascript"> //刷新保费收入 function refreshTop(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({ url:'${ctx}/cockpit/chart', data:{ "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2 }, //dataType:'json', success:function(data){ if(data!=null && data!=''){ //刷新保费收入 var sumPremCurDate = (data.sumPremCurDate).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); var sumPremCurMnth = (data.sumPremCurMnth).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); var sumPremCurYear = (data.sumPremCurYear).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); top_sumpremium_daystr.innerText = sumPremCurDate+'万'; top_sumpremium_monthstr.innerText = sumPremCurMnth+'万'; top_sumpremium_yearstr.innerText = sumPremCurYear+'万'; if(data.sumPremLstYear!=0){ top_sumpremium_yoystr.innerText = '同比'+'\n'+((data.sumPremCurYear-data.sumPremLstYear)/data.sumPremLstYear*100).toFixed(2)+'%'; }else{ top_sumpremium_yoystr.innerText = '同比'+'\n'+'-'; } }else{ var a = (0).toFixed(2); top_sumpremium_daystr.innerText = a+'万'; top_sumpremium_monthstr.innerText = a+'万'; top_sumpremium_yearstr.innerText = a+'万'; top_sumpremium_yoystr.innerText = '同比'+'\n'+'-'; } //变更保费收入 红上绿下 图标 var top_sumpremium_pic=((data.sumPremCurYear-data.sumPremLstYear)/data.sumPremLstYear).toFixed(2); var top_sumpremium_pic1 = parseFloat(top_sumpremium_pic); if(top_sumpremium_pic1>0){ $("#top_sumpremium_pic").removeClass('cartoon-down'); $("#top_sumpremium_pic").addClass('cartoon-up'); }else{ $("#top_sumpremium_pic").removeClass('cartoon-up'); $("#top_sumpremium_pic").addClass('cartoon-down'); } }, error:function(){ } }); } </script> <script type="text/javascript"> //刷新签单保费 function refreshTop1(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({ url:'${ctx}/cockpit/chart', data:{ "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2 }, //dataType:'json', success:function(data){ if(data!=null && data!=''){ //刷新签单保费 var signpremcurdate = (data.signpremcurdate).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); var signpremcurmnth = (data.signpremcurmnth).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); var signpremcuryear = (data.signpremcuryear).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); top_signpremlst_daystr.innerText = signpremcurdate+'万'; top_signpremlst_monthstr.innerText = signpremcurmnth+'万'; top_signpremlst_yearstr.innerText = signpremcuryear+'万'; if(data.sumPremLstYear!=0){ top_signpremlst_yoystr.innerText = '同比'+'\n'+((data.signpremcuryear-data.signpremlstyear)/data.signpremlstyear*100).toFixed(2)+'%'; }else{ top_signpremlst_yoystr.innerText = '同比'+'\n'+'-'; } }else{ var a = (0).toFixed(2); top_signpremlst_daystr.innerText = a+'万'; top_signpremlst_monthstr.innerText = a+'万'; top_signpremlst_yearstr.innerText = a+'万'; top_signpremlst_yoystr.innerText = '同比'+'\n'+'-'; } //变更签单保费 红上绿下 图标 var top_signpremlst_pic=((data.signpremcuryear-data.signpremlstyear)/data.signpremlstyear).toFixed(2); var top_signpremlst_pic1 = parseFloat(top_signpremlst_pic); if(top_signpremlst_pic1>0){ $("#top_signpremlst_pic").removeClass('cartoon-down'); $("#top_signpremlst_pic").addClass('cartoon-up'); }else{ $("#top_signpremlst_pic").removeClass('cartoon-up'); $("#top_signpremlst_pic").addClass('cartoon-down'); } }, error:function(){ } }); } </script> <script type="text/javascript"> //刷新保单年度制满期赔付率 function refreshTop2(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({ url:'${ctx}/cockpit/chartbdndmq', data:{ "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2 }, //dataType:'json', success:function(data){ if(data!=null && data!=''){ //刷新保单年度制满期赔付率 var bdndmqpfl = (data.bdndmqpfl).toFixed(2); top_bdndmqpfl.innerText = bdndmqpfl+'%'; if(data.lastrate != 0){ top_bdndmqpfl_yoystr.innerText = '同比'+'\n'+(data.lastrate).toFixed(2)+'%'; }else{ top_bdndmqpfl_yoystr.innerText = '同比'+'\n'+'-'; } }else{ var a = (0).toFixed(2); top_bdndmqpfl.innerText = a+'%'; top_bdndmqpfl_yoystr.innerText = '同比'+'\n'+'-'; } //变更保单年度制满期赔付率 红上绿下 图标 var top_bdndmqpfl_pic=((data.bdndmqpfl-data.lastrate)/data.lastrate).toFixed(2); var top_bdndmqpfl_pic1 = parseFloat(top_bdndmqpfl_pic); if(!top_bdndmqpfl_pic1<0){ $("#top_bdndmqpfl_pic").removeClass('cartoon-down'); $("#top_bdndmqpfl_pic").addClass('cartoon-up'); }else{ $("#top_bdndmqpfl_pic").removeClass('cartoon-up'); $("#top_bdndmqpfl_pic").addClass('cartoon-down'); } }, error:function(){ } }); } </script> <script type="text/javascript"> //刷新历年制赔付率 function refreshTop3(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({ url:'${ctx}/cockpit/chartlnz', data:{ "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2 }, //dataType:'json', success:function(data){ if(data!=null && data!=''){ //刷新历年制赔付率 var lnzpfl = (data.lnzpfl).toFixed(2);//保留2位小数 top_lnzpfl.innerText = lnzpfl+'%'; if(data.lastrate != 0){ top_lnzpfl_yoystr.innerText = '同比'+'\n'+(data.lastrate).toFixed(2)+'%'; }else{ top_lnzpfl_yoystr.innerText = '同比'+'\n'+'-'; } }else{ var a = (0).toFixed(2); top_lnzpfl.innerText = a+'%'; top_lnzpfl_yoystr.innerText = '同比'+'\n'+'-'; } //变更历年制赔付率 红上绿下 图标 var top_lnzpfl_pic=((data.lnzpfl-data.lastrate)/data.lastrate).toFixed(2); var top_lnzpfl_pic1 = parseFloat(top_lnzpfl_pic); if(!top_lnzpfl_pic1<0){ $("#top_lnzpfl_pic").removeClass('cartoon-down'); $("#top_lnzpfl_pic").addClass('cartoon-up'); }else{ $("#top_lnzpfl_pic").removeClass('cartoon-up'); $("#top_lnzpfl_pic").addClass('cartoon-down'); } }, error:function(){ } }); } </script> <script type="text/javascript"> function refreshChart3(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({//折线图 url:'${ctx}/cockpit/chart3', data:{ "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2, "selected":$("#sel_echart3 option:selected").val() }, dataType:'json', success:function(data){ renderChart3(data); }, error:function(){ } }); } </script> <script type="text/javascript"> function renderChart3(data){ var valuePrvnc = $('#sel_prvnc').val(); var valueChannel = $('#sel_channel').val(); var valueClasscode = $('#sel_classcode').val(); var name=data['Cname']; if(valuePrvnc == 00 && valueClasscode == 00&& valueChannel == 00){ var option = { grid:{ y : 50,//上边距 y2 : 20, //下边距 borderWidth : 0, background:'#fff' }, title : { text: name!=null?name:'日保费收入趋势图(单位:万)', x:'460', y:'10', textStyle:{ fontSize: 14, //fontWeight: 'bolder', fontFamily:'Microsoft YaHei' , color: '#333' } }, tooltip : { trigger: 'item' }, legend: { data:['同期保费','当期保费'] }, xAxis : [ { type : 'category', boundaryGap : false,//类目起始和结束两端空白策略,默认为true留空,false则顶头 data : data.split } ], yAxis : [ { type : 'value', axisLine :false, splitLine:{lineStyle:{ width: 1, type: 'dashed'}}, axisLabel : { formatter: '{value}' } } ], series : [ { name:'同期保费', type:'line', itemStyle : { normal : { //设置折线图折线点的颜色 color:'#FF7F50', lineStyle:{ //设置折线图折线颜色 color:'#FF7F50' } } }, data:data.lm }, { name:'日保费目标', type:'line', itemStyle : { normal : { //设置折线图折线点的颜色 color:'#1E90FF', lineStyle:{ //设置折线图折线颜色 color:'#1E90FF' } } }, data:data.gd }, { name:'当期保费', /* type:'line', */ type:'line', itemStyle : { normal : { //设置折线图折线点的颜色 color:'#68B028', lineStyle:{ //设置折线图折线颜色 color:'#68B028' } } }, data:data.cm } ] }; }else{ var option = { grid:{ x2: 20, y : 50,//上边距 y2 : 20, //下边距 borderWidth : 0, background:'#fff' }, title : { text: name!=null?name:'日保费收入趋势图(单位:万)', x:'460', y:'10', textStyle:{ fontSize: 14, //fontWeight: 'bolder', fontFamily:'Microsoft YaHei' , color: '#333' } }, tooltip : { trigger: 'item' }, legend: { x:'left', data:['同期保费','当期保费'] }, xAxis : [ { type : 'category', //纵向分割线 splitLine : { show : true, lineStyle : { color : '#f5f5f5', type : 'solid', width : 1 } }, boundaryGap : false,//类目起始和结束两端空白策略,默认为true留空,false则顶头 data : data.split } ], yAxis : [ { type : 'value', axisLine :false, //纵向分割线 splitLine : { show : true, lineStyle : { color : '#f1f1f1', type : 'dashed', width : 1 } }, axisLabel : { formatter: '{value}' } } ], series : [ { name:'同期保费', type:'line', itemStyle : { normal : { //设置折线图折线点的颜色 color:'#FF7F50', lineStyle:{ //设置折线图折线颜色 color:'#FF7F50' } } }, data:data.lm }, { name:'当期保费', type:'line', itemStyle : { normal : { //设置折线图折线点的颜色 color:'#68B028', lineStyle:{ //设置折线图折线颜色 color:'#68B028' } } }, data:data.cm } ] }; } //为echarts对象加载数据 chart3.clear(); chart3.setOption(option,true); } </script> <script type="text/javascript"> //加载仪表盘 //刷新图表3 function refreshChart13(prvnccode,citycode,countycode,classCode,codecode,busssourcecode1,busssourcecode2){ $.ajax({ url : '${ctx}/cockpit/chart13', type: 'post', data: { "prvnccode":prvnccode, "citycode":citycode, "countycode":countycode, "classcode":classCode, "codecode":codecode, "busssourcecode1":busssourcecode1, "busssourcecode2":busssourcecode2 }, dataType:'json', success: function(data){ rendChart13(data); }, error: function(){ //alert('error'); } }); } </script> <script type="text/javascript"> function rendChart13(data){//仪表盘 option = { title : { x: 'center', text:' 年保费计划完成情况', textStyle:{ fontSize: 14, fontWeight: 'bolder', fontFamily:'Microsoft YaHei' , color: '#333' } }, tooltip : { formatter: "{a} <br/>{b} : {c}%" }, series : [ { name:'保费计划完成情况', type:'gauge', splitNumber: 10, // 分割段数,默认为5 center : ['27%', '50%'], // 默认全局居中 radius : [0,'84%'], axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 color: [[0.2, '#FF7F50'],[0.8, '#FFAD00'],[1, '#68B028']], width: 8 } }, axisTick: { // 坐标轴小标记 splitNumber: 10, // 每份split细分多少段 length :12, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: 'auto' } }, axisLabel: { // 坐标轴文本标签,详见axis.axisLabel textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto' } }, splitLine: { // 分隔线 show: true, // 默认显示,属性show控制显示与否 length :30, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, pointer : { width : 5 }, title : { show : true, offsetCenter: [0, '-20%'], // x, y,单位px textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE fontWeight: 'bolder' } }, detail : { formatter:'{value}%', textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto', fontWeight: 'bolder' } }, data:[{value: data.planRatio.toFixed(2), name: '计划完成率'}] }, { name:'保费完成超进度比例', type:'gauge', splitNumber: 10, // 分割段数,默认为5 center : ['75%', '50%'], // 默认全局居中 radius : [0,'84%'], min:0, max:100, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 color: [[0.2,'#FF7F50'],[0.8, '#FFAD00'], [1, '#68B028']], width: 8 } }, axisTick: { // 坐标轴小标记 splitNumber: 10, // 每份split细分多少段 length :12, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: 'auto' } }, axisLabel: { // 坐标轴文本标签,详见axis.axisLabel textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto' } }, splitLine: { // 分隔线 show: true, // 默认显示,属性show控制显示与否 length :30, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, pointer : { width : 5 }, title : { show : true, offsetCenter: [0, '-20%'], // x, y,单位px textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE fontWeight: 'bolder' } }, detail : { formatter:'{value}%', textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto', fontWeight: 'bolder' } }, /* data:[{value: data.overRatio, name: '时间进度'}] */ /* data:[{value: 0.00, name: '时间进度'}] */ data:[{value: data.overRatio.toFixed(2), name: '时间进度'}] } ] }; chart13.clear(); chart13.setOption(option); } </script> <script type="text/javascript"> $(document).ready(function(){ function ajaxJigou3(){ $("#sel_company2").html(""); $.ajax({//自动获取 type:"post", url:"${ctx }/cockpit/jigou3", dataType:"json", data:{ "prvnccode" : $("#sel_company option:selected").val() }, success:function(sto){ if(sto.length==1&&sto[0].citycode.substring(0,6)=="${deptid}".substring(0,6)){ $.each(sto,function(i,item){ $("#sel_company2").append("<option value="+item.citycode+">"+item.cityname+"</option>"); }); refreshPage(); }else{ $("#sel_company2").append("<option value='00'>所有机构</option>"); $.each(sto,function(i,item){ $("#sel_company2").append("<option value="+item.citycode+">"+item.cityname+"</option>"); }); } } }); } if($("#sel_company option:selected").val()!='00'){ ajaxJigou3(); } $("#sel_company").change(function(){ if($("#sel_company option:selected").val()!='00'){ $("#sel_company3").html(""); $("#sel_company3").append("<option value='00'>所有机构</option>"); ajaxJigou3(); }else{ $("#sel_company3").html(""); $("#sel_company3").append("<option value='00'>所有机构</option>"); $("#sel_company2").html(""); $("#sel_company2").append("<option value='00'>所有机构</option>"); } refreshPage(); }); $("#sel_class").change(function(){ refreshPage(); }); $("#sel_channel").change(function(){ refreshPage(); }); $("#sel_echart3").change(function(){ refreshPage(); }); $("#sel_bus").change(function(){ $("#sel_bus2").html(""); var bus = $("#sel_bus option:selected").val(); if(bus!='00'){ $.ajax({//自动获取 type:"post", url:"${ctx }/cockpit/chartbs", dataType:"json", data:{ "busssourcecode1" : $("#sel_bus option:selected").val() }, success:function(sto){ $("#sel_bus2").append("<option value='00'>所有来源</option>"); $.each(sto,function(i,item){ $("#sel_bus2").append("<option value="+item.busssourcecode2+">"+item.busssourcename2+"</option>"); }); } }); }else{ $("#sel_bus2").append("<option value='00'>所有来源</option>"); } refreshPage(); }); $("#sel_bus2").change(function(){ refreshPage(); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ function ajaxJigou4(){ $("#sel_company3").html(""); $.ajax({//自动获取 type:"post", url:"${ctx }/cockpit/jigou4", dataType:"json", data:{ "citycode" : $("#sel_company2 option:selected").val() }, success:function(sto){ if(sto.length==1&&sto[0].countycode.substring(0,8)=="${deptid}".substring(0,8)){ $.each(sto,function(i,item){ $("#sel_company3").append("<option value="+item.countycode+">"+item.countyname+"</option>"); }); refreshPage(); }else{ $("#sel_company3").append("<option value='00'>所有机构</option>"); $.each(sto,function(i,item){ $("#sel_company3").append("<option value="+item.countycode+">"+item.countyname+"</option>"); }); } } }); } if($("#sel_company2 option:selected").val()!='00'){ ajaxJigou4(); } $("#sel_company").change(function(){ $("#sel_company3").html(""); $("#sel_company3").append("<option value='00'>所有机构</option>"); }); $("#sel_company2").change(function(){ if($("#sel_company2 option:selected").val()!='00'){ ajaxJigou4(); }else{ $("#sel_company3").html(""); $("#sel_company3").append("<option value='00'>所有机构</option>"); } refreshPage(); }); $("#sel_company3").change(function(){ refreshPage(); }); $("#sel_class").change(function(){ refreshPage(); }); $("#sel_channel").change(function(){ refreshPage(); }); $("#sel_echart3").change(function(){ refreshPage(); }); $("#sel_bus").change(function(){ $("#sel_bus2").html(""); var bus = $("#sel_bus option:selected").val(); if(bus!='00'){ $.ajax({//自动获取 type:"post", url:"${ctx }/cockpit/chartbs", dataType:"json", data:{ "busssourcecode1" : $("#sel_bus option:selected").val() }, success:function(sto){ $("#sel_bus2").append("<option value='00'>所有来源</option>"); $.each(sto,function(i,item){ $("#sel_bus2").append("<option value="+item.busssourcecode2+">"+item.busssourcename2+"</option>"); }); } }); }else{ $("#sel_bus2").append("<option value='00'>所有来源</option>"); } refreshPage(); }); $("#sel_bus2").change(function(){ refreshPage(); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ var sel_companyVal = $("#sel_company").val(); var sel_company2Val = $("#sel_company2").val(); var sel_company3Val = $("#sel_company3").val(); var sel_channelVal = $("#sel_channel").val(); var sel_classVal = $("#sel_class").val(); var sel_busVal = $("#sel_bus").val(); var sel_bus2Val = $("#sel_bus2").val(); refreshTop(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop1(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop2(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop3(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); }); </script> <script type="text/javascript"> function refreshPage(){ var sel_companyVal = $("#sel_company").val(); var sel_company2Val = $("#sel_company2").val(); var sel_company3Val = $("#sel_company3").val(); var sel_channelVal = $("#sel_channel").val(); var sel_classVal = $("#sel_class").val(); var sel_busVal = $("#sel_bus").val(); var sel_bus2Val = $("#sel_bus2").val(); refreshChart13(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshChart3(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop1(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop2(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); refreshTop3(sel_companyVal,sel_company2Val,sel_company3Val,sel_classVal,sel_channelVal,sel_busVal,sel_bus2Val); } </script> </body> </html> 那这个页面的四级机构是不是也可以使用$('#company').combotree({ data: JSON.parse('${companys}'), // 后端传入的机构数据 panelWidth: 260, // 下拉面板宽度 lines: true, // 显示树形连接线 editable: true, // 允许编辑过滤 multiple: true, // ✅ 关键:启用多选(复选框) prompt: "请选择", // 占位提示文本 onShowPanel: function() { // 展开时移除默认图标 $('.tree-folder').remove(); $('.tree-file').remove(); } });这段逻辑
07-17
#include <iostream> #include <string> #include <vector> #include <curl/curl.h> #include <nlohmann/json.hpp> #include <fstream> #include <conio.h> #include <windows.h> #include <iomanip> #include <chrono> #include <thread> using json = nlohmann::json; // 配置文件路径 const std::string CONFIG_PATH = "config.json"; // curl 响应回调函数 size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) { size_t newSize = size * nmemb; try { userp->append(static_cast<char*>(contents), newSize); } catch (const std::bad_alloc& e) { std::cerr << "内存分配失败" << std::endl; return 0; } return newSize; } // 读取配置文件 bool ReadConfig(std::string& apiKey, std::vector<std::string>& cities) { std::ifstream configFile(CONFIG_PATH); if (!configFile.is_open()) { std::cerr << "无法打开配置文件" << std::endl; return false; } try { json config; configFile >> config; apiKey = config["api_key"].get<std::string>(); cities = config["cities"].get<std::vector<std::string>>(); } catch (const json::exception& e) { std::cerr << "配置文件解析失败" << std::endl; return false; } return true; } // 获取天气数据 std::string FetchWeatherData(const std::string& city, const std::string& apiKey) { // 重试机制(最多3次) for (int attempt = 1; attempt <= 3; ++attempt) { CURL* curl = curl_easy_init(); if (!curl) { std::cerr << "curl 初始化失败" << std::endl; return ""; } std::string url = "https://api.openweathermap.org/data/2.5/forecast?q=" + city + "&appid=" + apiKey + "&units=metric&cnt=7"; std::string response; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); CURLcode res = curl_easy_perform(curl); if (res != CURLE_OK) { if (attempt < 3) { std::cerr << "请求失败,正在重试..." << std::endl; std::this_thread::sleep_for(std::chrono::seconds(attempt * 2)); } } else { long http_code = 0; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code); if (http_code == 200) { curl_easy_cleanup(curl); return response; } } curl_easy_cleanup(curl); } std::cerr << "天气数据获取失败(已达到最大重试次数)" << std::endl; return ""; } // 天气数据结构 struct WeatherInfo { std::string date; double temp; double feelsLike; int humidity; std::string desc; double windSpeed; }; // 解析天气 JSON std::vector<WeatherInfo> ParseWeather(const std::string& jsonStr, const std::string& cityName) { std::vector<WeatherInfo> weatherList; if (jsonStr.empty()) { std::cerr << "空 JSON 数据" << std::endl; return weatherList; } try { json data = json::parse(jsonStr); // 校验 API 状态码 if (data.contains("cod")) { int cod; if (data["cod"].is_number()) { cod = data["cod"].get<int>(); } else { std::string codStr = data["cod"].get<std::string>(); cod = std::stoi(codStr); } if (cod != 200) { std::string msg = data.contains("message") ? data["message"].get<std::string>() : "未知错误"; std::cerr << "API 错误: " << msg << std::endl; return weatherList; } } else { std::cerr << "JSON 中缺少 'cod' 字段" << std::endl; return weatherList; } // 检查是否有预报列表 if (!data.contains("list") || !data["list"].is_array()) { std::cerr << "JSON 中缺少 'list' 数组" << std::endl; return weatherList; } // 遍历预报列表 for (size_t i = 0; i < data["list"].size(); ++i) { const auto& item = data["list"][i]; WeatherInfo info; try { // 日期时间 if (item.contains("dt_txt") && item["dt_txt"].is_string()) { info.date = item["dt_txt"].get<std::string>(); } else { continue; } // 温度 if (item.contains("main") && item["main"].is_object()) { const auto& main = item["main"]; if (main.contains("temp")) { if (main["temp"].is_number()) { info.temp = main["temp"].get<double>(); } else { std::string tempStr = main["temp"].get<std::string>(); info.temp = std::stod(tempStr); } } else { continue; } if (main.contains("feels_like")) { if (main["feels_like"].is_number()) { info.feelsLike = main["feels_like"].get<double>(); } else { std::string feelsLikeStr = main["feels_like"].get<std::string>(); info.feelsLike = std::stod(feelsLikeStr); } } else { info.feelsLike = info.temp; } if (main.contains("humidity")) { if (main["humidity"].is_number()) { info.humidity = main["humidity"].get<int>(); } else { std::string humidityStr = main["humidity"].get<std::string>(); info.humidity = std::stoi(humidityStr); } } else { info.humidity = 0; } } else { continue; } // 天气描述 if (item.contains("weather") && item["weather"].is_array() && !item["weather"].empty()) { const auto& weather = item["weather"][0]; if (weather.contains("description") && weather["description"].is_string()) { info.desc = weather["description"].get<std::string>(); } else { info.desc = "未知"; } } else { info.desc = "未知"; } // 风速 if (item.contains("wind") && item["wind"].is_object() && item["wind"].contains("speed")) { if (item["wind"]["speed"].is_number()) { info.windSpeed = item["wind"]["speed"].get<double>(); } else { std::string windSpeedStr = item["wind"]["speed"].get<std::string>(); info.windSpeed = std::stod(windSpeedStr); } } else { info.windSpeed = 0.0; } weatherList.push_back(info); } catch (...) { continue; } } } catch (...) { std::cerr << "JSON 解析失败" << std::endl; } return weatherList; } // 配置控制台UTF-8支持和字体 bool SetupConsoleUTF8() { // 1. 清除控制台 system("cls"); // 2. 设置控制台输出为UTF-8编码 if (!SetConsoleOutputCP(CP_UTF8)) { std::cerr << "设置UTF-8输出编码失败,错误码: " << GetLastError() << std::endl; return false; } // 3. 获取控制台句柄 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if (hConsole == INVALID_HANDLE_VALUE) { std::cerr << "获取控制台句柄失败" << std::endl; return false; } // 4. 设置控制台字体为支持UTF-8的字体(尝试使用新宋体) CONSOLE_FONT_INFOEX cfi; cfi.cbSize = sizeof(cfi); if (!GetCurrentConsoleFontEx(hConsole, FALSE, &cfi)) { std::cerr << "获取当前控制台字体失败" << std::endl; return false; } // 尝试设置为"新宋体"(支持UTF-8的中文字体) wcscpy_s(cfi.FaceName, L"新宋体"); cfi.dwFontSize.Y = 12; // 字体大小 if (!SetCurrentConsoleFontEx(hConsole, FALSE, &cfi)) { std::cerr << "设置控制台字体失败,错误码: " << GetLastError() << std::endl; // 尝试使用默认等宽字体 wcscpy_s(cfi.FaceName, L"Lucida Console"); if (!SetCurrentConsoleFontEx(hConsole, FALSE, &cfi)) { std::cerr << "设置备用字体也失败,可能影响字符显示" << std::endl; } } // 5. 通过命令行再次确认设置(兼容旧系统) system("chcp 65001 > nul"); return true; } // 显示天气 void DisplayWeather(const std::vector<WeatherInfo>& weather, const std::string& city) { // 配置控制台UTF-8支持 if (!SetupConsoleUTF8()) { std::cerr << "控制台UTF-8配置失败,可能导致显示问题" << std::endl; } // 检查数据是否有效 if (weather.empty()) { std::cerr << "没有可用的天气数据" << std::endl; return; } std::cout << city << " 未来天气预报" << std::endl; std::cout << "----------------------------\n"; for (size_t i = 0; i < weather.size(); ++i) { const auto& info = weather[i]; std::cout << "日期: " << std::left << std::setw(12) << info.date.substr(0, 10); std::cout << " 温度: " << std::fixed << std::setprecision(1) << info.temp << "°C"; std::cout << " (体感 " << info.feelsLike << "°C)\n"; std::cout << "天气: " << std::left << std::setw(12) << info.desc; std::cout << " 湿度: " << std::setw(3) << info.humidity << "%"; std::cout << " 风速: " << std::fixed << std::setprecision(1) << info.windSpeed << " m/s\n"; std::cout << "----------------------------\n"; } } int main() { curl_global_init(CURL_GLOBAL_DEFAULT); std::string apiKey; std::vector<std::string> cities; if (!ReadConfig(apiKey, cities)) { std::cerr << "配置加载失败,程序退出" << std::endl; system("pause"); return 1; } int currentCityIdx = 0; const int cityCount = cities.size(); while (true) { std::string currentCity = cities[currentCityIdx]; std::cout << "正在获取 " << currentCity << " 的天气数据..." << std::endl; std::string weatherJson = FetchWeatherData(currentCity, apiKey); auto weatherData = ParseWeather(weatherJson, currentCity); if (!weatherData.empty()) { DisplayWeather(weatherData, currentCity); } else { std::cerr << currentCity << " 天气数据获取失败,15 秒后重试\n"; std::this_thread::sleep_for(std::chrono::seconds(15)); continue; } // 交互逻辑 std::cout << "\n操作:← 上一城市 → 下一城市 ESC 退出\n"; int key = _getch(); if (key == 224) { // 特殊键(箭头) key = _getch(); if (key == 75) { // 左箭头 currentCityIdx = (currentCityIdx - 1 + cityCount) % cityCount; } else if (key == 77) { // 右箭头 currentCityIdx = (currentCityIdx + 1) % cityCount; } } else if (key == 27) { // ESC 退出 break; } } curl_global_cleanup(); return 0; }为什么我的运行结果有一些是乱码,这该怎么解决,还有就是,你能不能帮我精进修改一下这个代码,我觉得这个代码有点长
07-06
导入必要的库 import pandas as pd import numpy as np import seaborn as sns from sklearn.model_selection import train_test_split, cross_val_score, learning_curve from sklearn.preprocessing import StandardScaler, LabelEncoder from sklearn.decomposition import PCA from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, roc_curve, auc from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, AdaBoostClassifier, ExtraTreesClassifier from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier from sklearn.naive_bayes import GaussianNB from sklearn.neural_network import MLPClassifier import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.patches import Patch import warnings warnings.filterwarnings(‘ignore’) 设置中文字体 plt.rcParams[‘font.sans-serif’] = [‘SimHei’] # 用来正常显示中文标签 plt.rcParams[‘axes.unicode_minus’] = False # 用来正常显示负号 尝试导入可选库 try: from xgboost import XGBClassifier XGB_AVAILABLE = True except ImportError: print(“XGBoost 不可用,跳过 XGBoost 模型”) XGB_AVAILABLE = False try: from lightgbm import LGBMClassifier LGBM_AVAILABLE = True except ImportError: print(“LightGBM 不可用,跳过 LightGBM 模型”) LGBM_AVAILABLE = False try: import shap SHAP_AVAILABLE = True except ImportError: print(“SHAP 不可用,跳过 SHAP 解释”) SHAP_AVAILABLE = False 定义张继权教授的四因子理论函数 def apply_four_factor_theory(df): # 检查所需的列是否存在 required_cols = [‘PFBA’, ‘PFPeA’, ‘PFHxA’, ‘PFHpA’, ‘PFOA’, ‘PFNA’, ‘PFDA’, ‘PFBS’, ‘PFHxS’, ‘PFOS’] available_cols = [col for col in required_cols if col in df.columns] if len(available_cols) < 4: print(f"警告: 只有 {len(available_cols)} 个PFAS列可用,可能需要调整四因子计算") # 短期酸类因子 (PFBA, PFPeA, PFHxA) short_term_cols = [col for col in ['PFBA', 'PFPeA', 'PFHxA'] if col in df.columns] if short_term_cols: df['Short_term_acid_factor'] = df[short_term_cols].mean(axis=1, skipna=True) else: df['Short_term_acid_factor'] = 0 # 长期酸类因子 (PFHpA, PFOA, PFNA, PFDA) long_term_cols = [col for col in ['PFHpA', 'PFOA', 'PFNA', 'PFDA'] if col in df.columns] if long_term_cols: df['Long_term_acid_factor'] = df[long_term_cols].mean(axis=1, skipna=True) else: df['Long_term_acid_factor'] = 0 # 磺酸类因子 (PFBS, PFHxS, PFOS) sulfonate_cols = [col for col in ['PFBS', 'PFHxS', 'PFOS'] if col in df.columns] if sulfonate_cols: df['Sulfonate_factor'] = df[sulfonate_cols].mean(axis=1, skipna=True) else: df['Sulfonate_factor'] = 0 # 暴露因子 (总PFAS浓度) all_pfas_cols = [col for col in required_cols if col in df.columns] if all_pfas_cols: df['Exposure_factor'] = df[all_pfas_cols].sum(axis=1, skipna=True) else: df['Exposure_factor'] = 0 return df 自定义表格打印函数 def print_table(data, headers=None, title=None): if title: print(f"\n{title}“) print(”=" * 60) if headers: # 打印表头 header_line = " | ".join(f"{h:>15}" for h in headers) print(header_line) print("-" * len(header_line)) # 打印数据行 for row in data: if isinstance(row, (list, tuple)): row_line = " | ".join(f"{str(item):>15}" for item in row) else: # 处理DataFrame行 row_line = " | ".join(f"{str(row[col]):>15}" for col in headers) print(row_line) 尝试多种编码方式读取文件 def read_csv_with_encodings(file_path): # 尝试的编码列表(中文环境中常见的编码) encodings = [‘utf-8’, ‘gbk’, ‘gb2312’, ‘gb18030’, ‘latin1’, ‘cp936’] for encoding in encodings: try: print(f"尝试使用 {encoding} 编码读取文件...") df = pd.read_csv(file_path, encoding=encoding) # 删除完全为空的行和列 df = df.dropna(how='all', axis=0) df = df.dropna(how='all', axis=1) print(f"成功使用 {encoding} 编码读取文件") return df except UnicodeDecodeError: continue except Exception as e: print(f"使用 {encoding} 编码时出错: {e}") continue # 如果所有编码都失败,尝试使用错误处理 try: print("尝试使用错误处理方式读取文件...") df = pd.read_csv(file_path, encoding='utf-8', errors='ignore') df = df.dropna(how='all', axis=0) df = df.dropna(how='all', axis=1) print("使用错误处理方式成功读取文件") return df except Exception as e: print(f"所有读取尝试都失败: {e}") return None 加载CSV文件并跳过完全为空的行列 file_path = r’E:\pycharm\meta\整合数据.csv’ # 使用原始字符串表示法 try: # 使用多种编码方式尝试读取文件 df = read_csv_with_encodings(file_path) if df is None: print("无法读取文件,请检查文件路径和格式") exit() print(f"数据形状: {df.shape}") print(f"列名: {df.columns.tolist()}") except Exception as e: print(f"读取文件时出错: {e}") exit() 数据预处理 检查PFAS相关列是否存在,如果不存在则尝试找到类似的列 expected_features = [‘PFBA’, ‘PFPeA’, ‘PFHxA’, ‘PFHpA’, ‘PFOA’, ‘PFNA’, ‘PFDA’, ‘PFBS’, ‘PFHxS’, ‘PFOS’] available_features = [] for feature in expected_features: if feature in df.columns: available_features.append(feature) else: # 尝试找到包含该字符串的列 matching_cols = [col for col in df.columns if feature.lower() in col.lower()] if matching_cols: available_features.extend(matching_cols) print(f"使用 ‘{matching_cols[0]}’ 替代 ‘{feature}’") 如果没有找到任何PFAS特征,使用所有数值列 if not available_features: numeric_cols = df.select_dtypes(include=[np.number]).columns.tolist() available_features = numeric_cols print(f"未找到PFAS特征,使用所有数值列: {available_features}") print(f"可用的PFAS特征: {available_features}") 检查目标列 target_column = ‘城市’ if target_column not in df.columns: # 尝试找到可能的目标列 possible_targets = [col for col in df.columns if any(word in col for word in [‘城市’, ‘地区’, ‘区域’, ‘地点’, ‘city’, ‘region’])] if possible_targets: target_column = possible_targets[0] print(f"使用 ‘{target_column}’ 作为目标变量") else: # 如果没有找到,使用第一列非数值列作为目标 non_numeric_cols = df.select_dtypes(exclude=[np.number]).columns if len(non_numeric_cols) > 0: target_column = non_numeric_cols[0] print(f"使用 ‘{target_column}’ 作为目标变量") else: # 如果没有非数值列,使用最后一列作为目标 target_column = df.columns[-1] print(f"使用最后一列 ‘{target_column}’ 作为目标变量") 处理缺失值(用中位数填充) for feature in available_features: if feature in df.columns: df[feature] = pd.to_numeric(df[feature], errors=‘coerce’) df[feature] = df[feature].fillna(df[feature].median()) 应用张继权教授的四因子理论 df = apply_four_factor_theory(df) 添加四因子到特征中 features = available_features + [‘Short_term_acid_factor’, ‘Long_term_acid_factor’, ‘Sulfonate_factor’, ‘Exposure_factor’] print(f"最终使用的特征: {features}") 编码目标变量(多分类) le = LabelEncoder() df[target_column] = le.fit_transform(df[target_column].fillna(‘Unknown’)) class_names = le.classes_ 分割数据集 X = df[features] y = df[target_column] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) print(f"训练集大小: {X_train.shape}“) print(f"测试集大小: {X_test.shape}”) print(f"目标变量类别数: {len(np.unique(y))}") 标准化特征 scaler = StandardScaler() X_train_scaled = scaler.fit_transform(X_train) X_test_scaled = scaler.transform(X_test) PCA降维(保留95%方差) pca = PCA(n_components=0.95) X_train_pca = pca.fit_transform(X_train_scaled) X_test_pca = pca.transform(X_test_scaled) print(f"PCA降维后特征数: {X_train_pca.shape[1]}") ========== 新增:相关性分析 ========== print(“\n进行相关性分析…”) 计算特征之间的相关性矩阵 correlation_matrix = X.corr() 绘制相关性热图 plt.figure(figsize=(12, 10)) sns.heatmap(correlation_matrix, annot=True, cmap=‘coolwarm’, center=0, fmt=‘.2f’) plt.title(‘特征相关性热图’) plt.tight_layout() plt.savefig(‘correlation_heatmap.png’, dpi=300, bbox_inches=‘tight’) plt.show() 找出高度相关的特征对 high_corr_pairs = [] for i in range(len(correlation_matrix.columns)): for j in range(i + 1, len(correlation_matrix.columns)): if abs(correlation_matrix.iloc[i, j]) > 0.8: # 阈值设为0.8 high_corr_pairs.append(( correlation_matrix.columns[i], correlation_matrix.columns[j], correlation_matrix.iloc[i, j] )) if high_corr_pairs: print(“高度相关的特征对:”) for pair in high_corr_pairs: print(f" {pair[0]} 和 {pair[1]}: {pair[2]:.3f}") else: print(“没有发现高度相关的特征对(相关系数>0.8)”) ========== 新增:Meta分析 - 数据分布可视化 ========== print(“\n进行Meta分析…”) 1. 目标变量分布 plt.figure(figsize=(10, 6)) df[target_column].value_counts().plot(kind=‘bar’) plt.title(‘目标变量分布’) plt.xlabel(‘类别’) plt.ylabel(‘样本数量’) plt.xticks(rotation=45) plt.tight_layout() plt.savefig(‘target_distribution.png’, dpi=300, bbox_inches=‘tight’) plt.show() 2. 四因子分布 four_factor_cols = [‘Short_term_acid_factor’, ‘Long_term_acid_factor’, ‘Sulfonate_factor’, ‘Exposure_factor’] if all(col in df.columns for col in four_factor_cols): fig, axes = plt.subplots(2, 2, figsize=(12, 10)) axes = axes.ravel() for i, col in enumerate(four_factor_cols): axes[i].hist(df[col], bins=30, alpha=0.7, color='skyblue', edgecolor='black') axes[i].set_title(f'{col} 分布') axes[i].set_xlabel(col) axes[i].set_ylabel('频率') plt.tight_layout() plt.savefig('four_factor_distribution.png', dpi=300, bbox_inches='tight') plt.show() 3. 特征箱线图 plt.figure(figsize=(15, 10)) X.boxplot() plt.title(‘特征箱线图’) plt.xticks(rotation=45) plt.tight_layout() plt.savefig(‘feature_boxplot.png’, dpi=300, bbox_inches=‘tight’) plt.show() 4. PCA可视化 plt.figure(figsize=(10, 8)) if X_train_pca.shape[1] >= 2: scatter = plt.scatter(X_train_pca[:, 0], X_train_pca[:, 1], c=y_train, cmap=‘viridis’, alpha=0.7) plt.colorbar(scatter) plt.xlabel(‘第一主成分’) plt.ylabel(‘第二主成分’) plt.title(‘PCA降维可视化’) plt.tight_layout() plt.savefig(‘pca_visualization.png’, dpi=300, bbox_inches=‘tight’) plt.show() 5. 累计方差解释率 plt.figure(figsize=(10, 6)) pca_full = PCA().fit(X_train_scaled) plt.plot(np.cumsum(pca_full.explained_variance_ratio_)) plt.xlabel(‘主成分数量’) plt.ylabel(‘累计方差解释率’) plt.title(‘PCA累计方差解释率’) plt.grid(True) plt.tight_layout() plt.savefig(‘pca_explained_variance.png’, dpi=300, bbox_inches=‘tight’) plt.show() ========== 模型训练和评估 ========== 定义机器学习模型 models = { ‘LogisticRegression’: LogisticRegression(max_iter=1000, random_state=42), ‘DecisionTree’: DecisionTreeClassifier(random_state=42), ‘RandomForest’: RandomForestClassifier(random_state=42), ‘SVM’: SVC(random_state=42, probability=True), ‘KNN’: KNeighborsClassifier(), ‘NaiveBayes’: GaussianNB(), ‘GradientBoosting’: GradientBoostingClassifier(random_state=42), ‘MLP’: MLPClassifier(max_iter=1000, random_state=42), ‘AdaBoost’: AdaBoostClassifier(random_state=42), ‘ExtraTrees’: ExtraTreesClassifier(random_state=42) } 添加可选模型 if XGB_AVAILABLE: models[‘XGBoost’] = XGBClassifier(use_label_encoder=False, eval_metric=‘mlogloss’, random_state=42) if LGBM_AVAILABLE: models[‘LightGBM’] = LGBMClassifier(random_state=42) print(f"将训练 {len(models)} 个模型") 训练和评估模型 results = [] cv_results = [] # 用于存储交叉验证结果 model_objects = {} # 存储训练好的模型对象 print(“开始训练模型…”) for name, model in models.items(): print(f"训练 {name}…") try: # 训练模型 model.fit(X_train_pca, y_train) model_objects[name] = model # 预测和评估 y_pred = model.predict(X_test_pca) y_pred_proba = model.predict_proba(X_test_pca) if hasattr(model, "predict_proba") else None acc = accuracy_score(y_test, y_pred) report = classification_report(y_test, y_pred, output_dict=True, zero_division=0) # 交叉验证 cv_scores = cross_val_score(model, X_train_pca, y_train, cv=5, scoring='accuracy') cv_mean = cv_scores.mean() cv_std = cv_scores.std() results.append([ name, acc, report['weighted avg']['precision'], report['weighted avg']['recall'], report['weighted avg']['f1-score'], cv_mean, cv_std ]) cv_results.append({ 'model': name, 'scores': cv_scores }) except Exception as e: print(f"训练模型 {name} 时出错: {e}") results.append([name, 0, 0, 0, 0, 0, 0]) 生成结果表格 headers = [‘Model’, ‘Accuracy’, ‘Precision’, ‘Recall’, ‘F1-Score’, ‘CV Mean’, ‘CV Std’] results_df = pd.DataFrame(results, columns=headers) results_df = results_df.sort_values(‘Accuracy’, ascending=False) print(“\n模型性能排名:”) print_table(results_df.values.tolist(), headers=headers, title=“模型性能比较”) ========== 新增:模型性能可视化 ========== print(“\n生成模型性能可视化…”) 1. 模型准确率比较 plt.figure(figsize=(12, 8)) models_names = results_df[‘Model’] accuracies = results_df[‘Accuracy’] cv_means = results_df[‘CV Mean’] cv_stds = results_df[‘CV Std’] x = np.arange(len(models_names)) width = 0.35 plt.bar(x - width / 2, accuracies, width, label=‘测试集准确率’, alpha=0.7) plt.bar(x + width / 2, cv_means, width, yerr=cv_stds, label=‘交叉验证准确率’, alpha=0.7, capsize=5) plt.xlabel(‘模型’) plt.ylabel(‘准确率’) plt.title(‘模型性能比较’) plt.xticks(x, models_names, rotation=45) plt.legend() plt.tight_layout() plt.savefig(‘model_performance_comparison.png’, dpi=300, bbox_inches=‘tight’) plt.show() 2. 交叉验证箱线图 cv_df = pd.DataFrame({item[‘model’]: item[‘scores’] for item in cv_results}) plt.figure(figsize=(12, 8)) cv_df.boxplot() plt.title(‘模型交叉验证准确率分布’) plt.xticks(rotation=45) plt.ylabel(‘准确率’) plt.tight_layout() plt.savefig(‘cv_boxplot.png’, dpi=300, bbox_inches=‘tight’) plt.show() 3. 最佳模型详细分析 best_model_name = results_df.iloc[0][‘Model’] best_model = model_objects[best_model_name] print(f"\n对最佳模型 {best_model_name} 进行详细分析…") 混淆矩阵 y_pred_best = best_model.predict(X_test_pca) cm = confusion_matrix(y_test, y_pred_best) plt.figure(figsize=(10, 8)) sns.heatmap(cm, annot=True, fmt=‘d’, cmap=‘Blues’, xticklabels=class_names, yticklabels=class_names) plt.title(f’{best_model_name} 混淆矩阵’) plt.xlabel(‘预测标签’) plt.ylabel(‘真实标签’) plt.tight_layout() plt.savefig(f’confusion_matrix_{best_model_name}.png’, dpi=300, bbox_inches=‘tight’) plt.show() 学习曲线 def plot_learning_curve(estimator, title, X, y, cv=None, n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5)): plt.figure(figsize=(10, 6)) train_sizes, train_scores, test_scores = learning_curve( estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes) train_scores_mean = np.mean(train_scores, axis=1) train_scores_std = np.std(train_scores, axis=1) test_scores_mean = np.mean(test_scores, axis=1) test_scores_std = np.std(test_scores, axis=1) plt.grid() plt.fill_between(train_sizes, train_scores_mean - train_scores_std, train_scores_mean + train_scores_std, alpha=0.1, color="r") plt.fill_between(train_sizes, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std, alpha=0.1, color="g") plt.plot(train_sizes, train_scores_mean, 'o-', color="r", label="训练得分") plt.plot(train_sizes, test_scores_mean, 'o-', color="g", label="交叉验证得分") plt.xlabel("训练样本数") plt.ylabel("得分") plt.title(title) plt.legend(loc="best") plt.tight_layout() plt.savefig(f'learning_curve_{best_model_name}.png', dpi=300, bbox_inches='tight') plt.show() plot_learning_curve(best_model, f’{best_model_name} 学习曲线’, X_train_pca, y_train, cv=5) 特征重要性(如果模型支持) if hasattr(best_model, ‘feature_importances_’): importances = best_model.feature_importances_ indices = np.argsort(importances)[::-1] plt.figure(figsize=(10, 8)) plt.title(f"{best_model_name} 特征重要性") plt.bar(range(min(20, len(importances))), importances[indices[:20]]) plt.xticks(range(min(20, len(importances))), [f'PC{i + 1}' for i in indices[:20]], rotation=45) plt.tight_layout() plt.savefig(f'feature_importance_{best_model_name}.png', dpi=300, bbox_inches='tight') plt.show() ========== 新增:SHAP特征分析组合图 ========== if SHAP_AVAILABLE: print(“\n生成SHAP特征分析组合图…”) # 只为最佳模型生成SHAP组合图 if best_model_name in ['RandomForest', 'DecisionTree', 'GradientBoosting', 'XGBoost', 'LightGBM']: try: # 创建SHAP解释器 explainer = shap.TreeExplainer(best_model) shap_values = explainer.shap_values(X_test_pca) # 对于多分类问题,选择第一个类别的SHAP值 if isinstance(shap_values, list): shap_values_used = shap_values[0] # 使用第一个类别的SHAP值 else: shap_values_used = shap_values # 创建组合图:全局重要性(左)与个体影响(右) fig = plt.figure(figsize=(20, 10)) gs = gridspec.GridSpec(1, 2, width_ratios=[1, 1]) # 左图:全局特征重要性 ax1 = plt.subplot(gs[0]) shap.summary_plot(shap_values_used, X_test_pca, plot_type="bar", feature_names=[f'PC{i + 1}' for i in range(X_test_pca.shape[1])], show=False, max_display=15) ax1.set_title(f'{best_model_name} - SHAP全局特征重要性', fontsize=16, fontweight='bold') # 右图:个体样本SHAP值 ax2 = plt.subplot(gs[1]) # 选择一个有代表性的样本(SHAP值绝对值最大的样本) sample_idx = np.argmax(np.sum(np.abs(shap_values_used), axis=1)) # 绘制瀑布图显示个体样本的SHAP值 shap.waterfall_plot( explainer.expected_value[0] if isinstance(explainer.expected_value, list) else explainer.expected_value, shap_values_used[sample_idx], feature_names=[f'PC{i + 1}' for i in range(X_test_pca.shape[1])], show=False, max_display=15) ax2.set_title(f'{best_model_name} - 个体样本SHAP值分析\n(样本索引: {sample_idx})', fontsize=16, fontweight='bold') plt.tight_layout() plt.savefig(f'shap_combined_{best_model_name}.png', dpi=300, bbox_inches='tight') plt.show() # 创建另一个组合图:SHAP摘要图与依赖图 fig2 = plt.figure(figsize=(20, 10)) gs2 = gridspec.GridSpec(1, 2, width_ratios=[1, 1]) # 左图:SHAP摘要图(显示特征值与SHAP值的关系) ax3 = plt.subplot(gs2[0]) shap.summary_plot(shap_values_used, X_test_pca, feature_names=[f'PC{i + 1}' for i in range(X_test_pca.shape[1])], show=False, max_display=15) ax3.set_title(f'{best_model_name} - SHAP摘要图', fontsize=16, fontweight='bold') # 右图:SHAP依赖图(最重要的特征) ax4 = plt.subplot(gs2[1]) # 找到最重要的特征 if hasattr(best_model, 'feature_importances_'): feature_importances = best_model.feature_importances_ most_important_feature = np.argmax(feature_importances) else: # 如果没有feature_importances_属性,使用SHAP值计算重要性 feature_importances = np.mean(np.abs(shap_values_used), axis=0) most_important_feature = np.argmax(feature_importances) shap.dependence_plot(most_important_feature, shap_values_used, X_test_pca, feature_names=[f'PC{i + 1}' for i in range(X_test_pca.shape[1])], show=False, ax=ax4) ax4.set_title(f'{best_model_name} - SHAP依赖图\n(最重要的特征: PC{most_important_feature + 1})', fontsize=16, fontweight='bold') plt.tight_layout() plt.savefig(f'shap_detailed_{best_model_name}.png', dpi=300, bbox_inches='tight') plt.show() print(f"已保存 SHAP组合图 for {best_model_name}") except Exception as e: print(f"生成SHAP组合图失败 for {best_model_name}: {e}") else: print(f"最佳模型 {best_model_name} 不支持TreeExplainer,跳过SHAP组合图") else: print(“\nSHAP不可用,跳过SHAP组合图”) ========== 生成四因子表格 ========== four_factor_cols = [‘Short_term_acid_factor’, ‘Long_term_acid_factor’, ‘Sulfonate_factor’, ‘Exposure_factor’] if all(col in df.columns for col in four_factor_cols): four_factor_table = df[[target_column] + four_factor_cols].head(10) # 解码目标变量以显示原始标签 four_factor_table[target_column] = le.inverse_transform(four_factor_table[target_column]) print_table(four_factor_table.values.tolist(), headers=[target_column] + four_factor_cols, title=“四因子理论表格 (前10行)”) ========== 生成PCA组件表格 ========== pca_components = pd.DataFrame(pca.components_, columns=features) print(f"\nPCA主成分表格 (前5个主成分)😊 print_table(pca_components.head().values.tolist(), headers=[‘PC’] + features, title=“PCA主成分权重”) ========== 保存重要结果 ========== results_df.to_csv(‘model_results.csv’, index=False) print(“\n模型结果已保存到 ‘model_results.csv’”) 显示最佳模型 best_model = results_df.iloc[0] print(f"\n最佳模型: {best_model[‘Model’]} (准确率: {best_model[‘Accuracy’]:.4f})") print(“\n所有图表已生成完成!”)完善改进代码
11-12
#pragma warning (disable:4996) #include <stdio.h> #include <time.h> #include <stdlib.h> #include <string.h> #define recordfile "D:\\record.txt" //购买记录信息结构体 typedef struct record { int member_id; // 用户名ID int Book_id; // 书籍 float pay; // 实际付款 char note[20]; // VIP会员的备注,普通会员无 char date[50]; // 购买日期 struct record* next; }Record; void recordinfo_save(); void recordinfo_load(); Record* Record_head_create(); Record* RecordHead = Record_head_create(); //记录信息头指针 Record* Record_head_create() { //动态申请内存 struct record* head = (Record*)malloc(sizeof(Record)); if (head == NULL) return NULL; head->next = NULL; return head; } void recordinfo_load() { FILE* fp = fopen(recordfile, "r"); if (fp == NULL) { return; } while (!feof(fp))//顺序读取文件内容,到达文件尾则返回0 { Record* NewRecord = (Record*)malloc(sizeof(Record)); if (NewRecord == NULL) return; NewRecord->next = NULL; fscanf(fp, "%d %d %f %s %s", &NewRecord->member_id, &NewRecord->Book_id, &NewRecord->pay, NewRecord->note, NewRecord->date); //添加到链表尾部 if (RecordHead->next == NULL) { RecordHead->next = NewRecord; printf("%-6d %-6d %-6.2f %-6s %s\n", NewRecord->member_id, NewRecord->Book_id, NewRecord->pay, NewRecord->note, NewRecord->date); } else { Record* ph = RecordHead; while (ph->next != NULL) { ph = ph->next; } ph->next = NewRecord; printf("%-6d %-6d %-6.2f %-6s %s\n", NewRecord->member_id, NewRecord->Book_id, NewRecord->pay, NewRecord->note, NewRecord->date); } } fclose(fp); } //购买记录文件保存 void recordinfo_save() { FILE* fp = fopen(recordfile, "w"); if (fp == NULL) { return; 为什么读取会陷入死循环输出乱码,怎么改进让他一行一行正常读取并打印 } Record* ph = RecordHead->next; while (ph != NULL) { fprintf(fp, "%d %d %f %s %s", ph->member_id, ph->Book_id, ph->pay, ph->note, ph->date); ph = ph->next; } fclose(fp); } void main() { recordinfo_load(); return ; }
07-13
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.cluster import KMeans from sklearn.preprocessing import StandardScaler, LabelEncoder from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import classification_report, confusion_matrix from mlxtend.frequent_patterns import apriori, association_rules import warnings warnings.filterwarnings('ignore') plt.rcParams['font.sans-serif'] = ['SimHei'] # 用于显示中文 plt.rcParams['axes.unicode_minus'] = False # ====================== 加载数据 ====================== file_path = 'final_train_ready.csv' data = pd.read_csv(file_path) # 删除无关列 drop_cols = ['ID', 'Delivery_person_ID', 'Order_Date', 'Time_Orderd', 'Time_Order_picked'] data.drop(columns=[col for col in drop_cols if col in data.columns], inplace=True) # ======== 清洗 Time_taken(min) 字段 ======== data['Time_taken(min)'] = ( data['Time_taken(min)'] .astype(str) .str.replace(r'[^\d.]', '', regex=True) .replace('', np.nan) .astype(float) ) print(f" 数据加载完成:{data.shape[0]} 行 × {data.shape[1]} 列\n") # ================== 关联规则挖掘================== print(" 开始:关联规则挖掘(购物篮分析思想)\n") # 选择分类变量 + 时间段作为维度 cat_vars = ['Weatherconditions', 'Road_traffic_density', 'Type_of_order', 'Type_of_vehicle', 'Festival', 'City', 'Order_Period'] subset_data = data[cat_vars].copy() # 将所有字段转为字符串类别 for col in subset_data.columns: subset_data[col] = subset_data[col].astype(str) # One-Hot 编码(独热编码) oht = pd.get_dummies(subset_data) oht = oht.groupby(level=0, axis=1).sum() # 合并重复列 # 应用 Apriori 获取频繁项集 frequent_items = apriori(oht, min_support=0.1, use_colnames=True) # 生成关联规则 rules = association_rules(frequent_items, metric="lift", min_threshold=1.0) rules = rules.sort_values(['lift', 'confidence'], ascending=False) # 筛选高置信度规则 strong_rules = rules[rules['confidence'] >= 0.5] print(f" 发现 {len(strong_rules)} 条强关联规则(confidence ≥ 0.5):\n") for idx, row in strong_rules.head(10).iterrows(): # 可调整显示条数 # 展开前件(antecedents) antecedent_terms = [f"{item}" for item in row['antecedents']] antecedent_str = " 且 ".join(antecedent_terms) # 展开后件(consequents) consequent_terms = [f"{item}" for item in row['consequents']] consequent_str = " 且 ".join(consequent_terms) # 格式化输出 print(f" 若 {antecedent_str} → 则 {consequent_str} " f"(支持度={row['support']:.3f}, 置信度={row['confidence']:.3f}, 提升度={row['lift']:.3f})") # ================== 分类模型构建 ================== print(" 开始:分类模型构建 —— 预测配送时间等级\n") # 目标变量:将连续时间划分为三类(短、中、长) time_labels = [0, 1, 2] # 0=短, 1=中, 2=长 data['Time_Category'] = pd.qcut(data['Time_taken(min)'], q=3, labels=time_labels) # 特征工程:编码分类变量 le = LabelEncoder() X_cat = data.select_dtypes(include=['object']).apply(lambda x: le.fit_transform(x.astype(str))) X_num = data.select_dtypes(include=[np.number]).drop(columns=['Time_taken(min)', 'Time_Category'], errors='ignore') X = pd.concat([X_cat, X_num], axis=1) y = data['Time_Category'] # 划分训练/测试集 X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y) # 训练随机森林分类器 clf = RandomForestClassifier(n_estimators=100, random_state=42, class_weight='balanced') clf.fit(X_train, y_train) y_pred = clf.predict(X_test) # 输出评估结果 print(" 分类性能报告:") print(classification_report(y_test, y_pred, target_names=['Short', 'Medium', 'Long'])) # 可视化混淆矩阵 # plt.figure(figsize=(6, 5)) # cm = confusion_matrix(y_test, y_pred) # sns.heatmap(cm, annot=True, fmt='d', cmap='Blues', xticklabels=['Short','Medium','Long'], yticklabels=['Short','Medium','Long']) # plt.title('Confusion Matrix - Delivery Time Classification') # plt.xlabel('Predicted') # plt.ylabel('Actual') # plt.tight_layout() # plt.show() print("-" * 60) # ================== 聚类分析 ================== print("📊 开始:聚类分析 —— 订单行为分群\n") # === 提取用于聚类的特征 === cluster_features = [ 'Delivery_person_Ratings', 'Delivery_Distance', 'multiple_deliveries', 'Time_taken(min)', 'Order_Hour' ] X_clust = data[cluster_features].copy() # === 关键步骤1:逐列强制转为数值类型(字符串→float)=== for col in X_clust.columns: if col == 'multiple_deliveries': # 特殊处理 pattern = r'[^\d.]' X_clust[col] = ( X_clust[col].astype(str) .str.replace(pattern, '', regex=True) .replace('', np.nan) .astype(float) ) else: X_clust[col] = pd.to_numeric(X_clust[col], errors='coerce') # === 检查转换结果 === print("\n🔍 各列数据类型(转换后):") print(X_clust.dtypes) print("\n🧩 缺失值统计(转换后):") print(X_clust.isnull().sum()) # === 关键步骤2:安全填充均值 === numeric_columns = X_clust.select_dtypes(include=[np.number]).columns.tolist() X_clust_filled = X_clust[numeric_columns].copy() for col in numeric_columns: if X_clust_filled[col].isnull().any(): mean_val = X_clust_filled[col].mean() X_clust_filled[col].fillna(mean_val, inplace=True) # === 再次检查是否还有 NaN === assert not X_clust_filled.isnull().any().any(), "仍有 NaN,请检查!" print("✅ 数据清洗完成,共 {} 个样本".format(len(X_clust_filled))) # === 标准化 === scaler = StandardScaler() X_scaled = scaler.fit_transform(X_clust_filled) X_scaled_df = pd.DataFrame(X_scaled, columns=numeric_columns) # === 肘部法找最优 k === inertias = [] k_range = range(1, 10) for k in k_range: kmeans = KMeans(n_clusters=k, random_state=42, n_init=10) kmeans.fit(X_scaled) inertias.append(kmeans.inertia_) # 可视化肘部图(可选开启) # plt.figure(figsize=(8, 5)) # plt.plot(k_range, inertias, 'bo-', linewidth=2, markersize=6) # plt.axvline(x=3, color='r', linestyle='--', label='k=3') # plt.title('Elbow Method for Optimal k') # plt.xlabel('Number of Clusters (k)') # plt.ylabel('Inertia') # plt.legend() # plt.grid(True) # plt.tight_layout() # plt.show() # === K-Means 聚类(k=3)=== optimal_k = 3 kmeans_final = KMeans(n_clusters=optimal_k, random_state=42, n_init=10) clusters = kmeans_final.fit_predict(X_scaled) # === 写回原数据 === data['Cluster'] = np.nan data.loc[X_clust_filled.index, 'Cluster'] = clusters data['Cluster'] = data['Cluster'].astype('int') # === 输出结果 === print(f"🎯 聚类完成!共分为 {optimal_k} 类:") print(data['Cluster'].value_counts().sort_index()) # print(data[['multiple_deliveries', 'Delivery_Distance']].dtypes) # # data['multiple_deliveries'] = pd.to_numeric(data['multiple_deliveries'], errors='coerce') # data['Delivery_Distance'] = pd.to_numeric(data['Delivery_Distance'], errors='coerce') # data['Time_taken(min)'] = pd.to_numeric(data['Time_taken(min)'], errors='coerce') # data['Order_Hour'] = pd.to_numeric(data['Order_Hour'], errors='coerce') # # for col in numeric_columns: # data[col].fillna(data[col].mean(), inplace=True) # print(data[numeric_columns].dtypes) # # print(data[['multiple_deliveries', 'Delivery_Distance']].dtypes) # 各簇特征均值 cluster_profile = data.groupby('Cluster')[cluster_features].mean() print("\n📌 各类特征均值对比:") print(cluster_profile.round(2)) # === 可视化聚类结果 === # plt.figure(figsize=(8, 6)) # sns.scatterplot( # data=data, # x='Delivery_Distance', # y='Time_taken(min)', # hue='Cluster', # palette='Set1', # alpha=0.7 # ) # plt.title('K-Means Clustering: Delivery Distance vs Time Taken') # plt.xlabel('配送距离 (km)') # plt.ylabel('配送时间 (分钟)') # plt.legend(title='簇编号') # plt.grid(True) # plt.tight_layout() # plt.show() print("\n🎉 聚类分析成功完成!") C:\Users\32773\.conda\envs\mining\python.exe "C:\Users\32773\Desktop\外卖消费行为处理好的数据1\外卖消费行为处理好的数据\data mining.py" 数据加载完成:45593 行 × 18 列 开始:关联规则挖掘(购物篮分析思想) 发现 212 条强关联规则(confidence ≥ 0.5): 若 Order_Period_下午茶 → 则 Road_traffic_density_Medium 且 Festival_No (支持度=0.125, 置信度=0.857, 提升度=3.626) 若 Road_traffic_density_Medium 且 Festival_No → 则 Order_Period_下午茶 (支持度=0.125, 置信度=0.529, 提升度=3.626) 若 Order_Period_下午茶 且 Festival_No → 则 Road_traffic_density_Medium (支持度=0.125, 置信度=0.869, 提升度=3.620) 若 Road_traffic_density_Medium → 则 Order_Period_下午茶 且 Festival_No (支持度=0.125, 置信度=0.521, 提升度=3.620) 若 Order_Period_下午茶 → 则 Road_traffic_density_Medium (支持度=0.127, 置信度=0.868, 提升度=3.616) 若 Road_traffic_density_Medium → 则 Order_Period_下午茶 (支持度=0.127, 置信度=0.527, 提升度=3.616) 若 Order_Period_早餐 → 则 Festival_No 且 Road_traffic_density_Low (支持度=0.125, 置信度=0.990, 提升度=2.950) 若 Order_Period_早餐 → 则 Road_traffic_density_Low (支持度=0.126, 置信度=1.000, 提升度=2.946) 若 Order_Period_早餐 且 Festival_No → 则 Road_traffic_density_Low (支持度=0.125, 置信度=1.000, 提升度=2.946) 若 Road_traffic_density_Jam 且 Type_of_vehicle_motorcycle → 则 City_Metropolitian 且 Order_Period_晚餐 (支持度=0.143, 置信度=0.791, 提升度=1.610) 开始:分类模型构建 —— 预测配送时间等级 分类性能报告: precision recall f1-score support Short 0.79 0.76 0.77 3150 Medium 0.63 0.71 0.67 3004 Long 0.90 0.82 0.85 2965 accuracy 0.76 9119 macro avg 0.77 0.76 0.77 9119 weighted avg 0.77 0.76 0.77 9119 ------------------------------------------------------------ 📊 开始:聚类分析 —— 订单行为分群 🔍 各列数据类型(转换后): Delivery_person_Ratings float64 Delivery_Distance float64 multiple_deliveries float64 Time_taken(min) float64 Order_Hour int64 dtype: object 🧩 缺失值统计(转换后): Delivery_person_Ratings 1908 Delivery_Distance 0 multiple_deliveries 993 Time_taken(min) 0 Order_Hour 0 dtype: int64 ✅ 数据清洗完成,共 45593 个样本 🎯 聚类完成!共分为 3 类: Cluster 0 12727 1 32704 2 162 Name: count, dtype: int64 Traceback (most recent call last): File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 1944, in _agg_py_fallback res_values = self._grouper.agg_series(ser, alt, preserve_dtype=True) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\ops.py", line 873, in agg_series result = self._aggregate_series_pure_python(obj, func) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\ops.py", line 894, in _aggregate_series_pure_python res = func(group) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 2461, in <lambda> alt=lambda x: Series(x, copy=False).mean(numeric_only=numeric_only), ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\series.py", line 6570, in mean return NDFrame.mean(self, axis, skipna, numeric_only, **kwargs) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\generic.py", line 12485, in mean return self._stat_function( ~~~~~~~~~~~~~~~~~~~^ "mean", nanops.nanmean, axis, skipna, numeric_only, **kwargs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\generic.py", line 12442, in _stat_function return self._reduce( ~~~~~~~~~~~~^ func, name=name, axis=axis, skipna=skipna, numeric_only=numeric_only ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\series.py", line 6478, in _reduce return op(delegate, skipna=skipna, **kwds) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\nanops.py", line 147, in f result = alt(values, axis=axis, skipna=skipna, **kwds) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\nanops.py", line 404, in new_func result = func(values, axis=axis, skipna=skipna, mask=mask, **kwargs) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\nanops.py", line 720, in nanmean the_sum = _ensure_numeric(the_sum) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\nanops.py", line 1701, in _ensure_numeric raise TypeError(f"Could not convert string '{x}' to numeric") TypeError: Could not convert string '4.54.74.64.84.24.744.24.94.14.344.344.13.54.64.3NaN 4.74.84.24.44.64.54.14.64.74.44.64.24.44.64.34.23.84.94.24.74.94.64.24.13.94.644.44.14.84.34.74.6NaN 4.94.73.94.74.344.14.643.94.84.54.14.44.64.74.84.44.74.644.84NaN 4.44.24.24.94.44.94.14.34.54.94.74.14.44.53.84.44NaN 3.94.34.64.74.54.44.44.24.53.94.6NaN 44.54.14.13.73.8444.84.84.34.24.22.64.34.94444.94.84.64.44.14.44.74.954.94.84.24.44.34.743.54.64.73.74.64.554.74.24.44.94.74.23.84.14.34.153.544.54.14.14.54.14.34.84.74.84.32.53.63.94.83.944.34.13.53.64.44.64.14.34.24.24.94.454.24.84.73.94.844.74.43.83.54.24.444.84.64.94.44.84.24.94.44.94.14.64.154.34.44.14.94.14.244.94.44.54.34.64.54.93.94.154.24.84.254.73.844.73.84.44.14.13.64.74.9NaN 4.14.24.34.14.14.24.454.84.94.34.42.54.63.74.74.14.44.34.54.34.254.34.74.33.53.84.64.64.44.94.84.84.94.13.84.54.64.94.34.64.24.64.64.84.64.15NaN 44.54.34.64.244.14.6444.64.24.44.64.14.34.8NaN 4.74.44.544.84.44.34.84.14.54.54.554.94.14.14.34.64.34.9NaN 4.84.544.2444.54.74.94.74.24.3NaN 4.14.84.34.84.14.454.544.33.74.34.94.44.94.84.64.72.54.64.64.64.64.14.14.644.64.74.62.644.944.24NaN 4.544.644.24.544.13.144.54.34.44.1NaN 3.54.84.94.74.14.34.74.94.3NaN 4.44.94.93.84.94.64.64.84.244.24.84.72.7NaN 4.14.94.44.84.14.244.44.54.64.64.34.73.54.454.44.13.54.14.84.54.13.84.73.754.84.64.64NaN 4.23.64.64.84.44.24.54.14.54.83.84.44.44.24.64.34.34.44.74.34.33.53.54.74.854.144.94.54.84.34.64.14.83.544.84.44.44.93.63.53.84.34.94.14.24.64.84.64.14.554.84.34.73.94.744.54.64.84.84.54.64.74.33.9NaN 4.144.6NaN 4.33.94.34.33.73.844.74.44.444.94.14.14.2NaN 4.84.34.353.64.343.84.64.54.244.4NaN 4.54.34.14.8NaN 4.4NaN NaN 4.22.64.44.44.13.63.54.14.94.14.64.94.74.74.74.74.64.44.344.64.14.244.14.64.54.54.24.94.54.64.44.64.33.84.64.14.44.94.64.144.74.33.64.54.24.44.1NaN 4.14.74.64.94.74.24.643.14.44.14.44.84.84.94.64.44.94.34.64.44.84.64.24.24.14.54.24.644.54NaN 4.24.94.74.34.64.14.54.94.44.43.8NaN 144.44.44.94.33.54.24.24.94.44.954.54.84.84.34.44.44.84.14.44.64.24.944.24.74.44.43.74.24.244.44.83.84.24.74.24.74.2544.64.24.13.14.24.34.14.143.54.64.44.54.64.244.84.24.64.54.65NaN 4.14.64.44.44.14.93.84.44.744.14.14.1NaN 4.14.63.544.12.5NaN 4.14.24.24.13.94.54.84.44.34.24.64.54.73.74.54.54.64.94.24.74.54.23.94.4444.7NaN 4.44.94.94.64.44.44.34.32.54.34.44.44.44.544.34.44.84.44.154.64.94.24.13.54.714.64.54.14.14.24.744.34.64.814.63.64.344.84.4543.54.14.34.2444.83.54.34.44.74.14.44.64.34.84.44.454.24.64.44.24.24.42.74.74.8NaN 4.74.14.5NaN 4.64.44.354.64.34.14.74.643.94.24.63.944.94.44.74.13.54.244.64.13.64.34.444.144.93.74.44.34.24.14.54.254.13.84.34.43.74.6NaN 4.64.23.54.444.64.44.74.64.14.84.34.24.64.74.34.63.64.74.64.33.5NaN 554.14.24.64.74.34.344.3NaN 44.444.74NaN 4.64.23.1454.64.94.24.44.744.64.84.44.14.64.14.73.54.44.44.33.53.23.34.6NaN 4.64.654.22.74.44.64.73.54.14.844.34.24.94.444.54.64.14.54.24.33.8444.33.64.6444.74.14.14.64.64.74.94.94.54.14.44.63.14.64.74.93.84.644.44.34.43.73.94.53.84.14.24.64.1NaN 4.64.54.34.64.54.2NaN 3.654.24.34.64.84.64.54.454.44.13.5NaN 4.23.84.54.54.94.6454.54.7NaN 4.2NaN 4.44.44.64.24.34.34.54.54.44.24.64.64.24.24.64.74.94.74.53.54.13.74.3454.44.14.64.84.64.74.64.54.44.7NaN 4.34.74.24.54.54.72.63.14.64.94.14.83.64.24.33.74.34.34.54.44.844.52.64.344.33.54.64.154.14NaN 3.64.34.34.64.54.64.14.14.14.63.54.54.94.14.654.74.84.44.34.24.24.24.34.84.244.34.44.3NaN 4.14.143.94.54.74.74.83.84.14.44.454.74.64.34.444.44.1444.14.94.54.44.74.64.64.74.8NaN 4.64.444.54.84.64.2454.64.34.24.43.64.44.24.34.94.94.94.6NaN 4.34.74.64.2NaN 4.14.94.84.73.74.943.54.454.94.44.64.14.44.64.94.84.34.34.64.44.44NaN 4.84.34.74.94.34.74.1NaN 4.14.844.64.24.64.944.74NaN 4.74.84.23.74.84.44.44.84.64.74.14.33.94.34.64.73.73.44.74.84.64.54.14.14.74.14.144.64.8NaN 4.24.54.54.14.34.94.24.64.24.7NaN 4.143.63.84.24.654.34.14.43.84.44.84.53.74.64.24.84.74.64.64.84.94.94.34.14.84.24.14.154.14.74.84.454.14.44.24.94.24.34.644.44.43.94.54.34.13.44.2454.44.14.44.64.24.34.23.54.43.64.14.14.44.74.44.74.34.2NaN 4.74.63.74.34.14.74.34.14.24.64.84.74.34.64.54.74.24.24.94.74.14.74.44.844.24.23.73.24.14.44.14.64.44.63.74.74.44.84.94.33.84.44.14.354.744.33.7444.14.354.34.94.82.74.14.44.84.544.44.34.14.33.64.44.94.84.4NaN 4.94.844.84.14.54.54.64.43.73.74.14.12.84.944.24.14.44.94.33.54.844.54.94.34.444.54.94.9NaN 4.14.33.53.84.13.73.84.14.24.74.14.34.84.74.443.54.64.34.443.54.14.54.24.54.144.74.24.84.34.44.444.14.64.54.14.34.24.544.84.94.7NaN 4.23.8NaN 3.34.24.14.74.24.74.54.14.74.34.34.64.64.53.554.854.94.64.34.64.14.34.14.44.3NaN 54.54.44.54.44.14.14.64.344.14.64.24.44.14.74.24.144.94.13.84.84.94.54.24.74.13.94.42.84.1NaN 3.744.23.24.14.23.74.94.2444.943.94.44.84.24.63.44.544.34.344.84.14.13.94.843.54.24.344.54.254.44.23.54.54.64.84.214.14444.14.74.34.84.64.24.94.254.34.83.9NaN 4.84.14.74.84.54.34.84.74.93.344.74.74.44.74.24.43.94.14.14.54.24.24.24.54.94.64.14.94.74.64.43.74.44.13.34.44.34.14.442.94NaN 3.54.13.83.64.64.74.14.14.14.94.2NaN 4.34.84.24.34.34.74.444.44.24.344.34.44.74.344.6NaN 4.24.24.54.2NaN 4.64.74.74.554.54.654.24.554.13.5544.74.43.84.44.63.84.854.944.64.94.83.84.84.6NaN 4.24.64.44.24.64.94.544.74.154.94.84.44.444.44.54.53.54.74.64.244.44.53.74.643.54.34.84.34.34.84.544.554.454.24.24.24.84.94.84.64.3NaN 44.64.94.64.54.74.44.84.54.14.34.14.54.24.74.74.64.34.84.6NaN 54.44.74.64.64.13.94.64.24.63.84.94.94.32.94.353.74.154.53.84.34.34.9NaN 4.94.54.24.24.44.84.1NaN 4.24.84.14.54.1443.954.14.63.5444.14.6NaN 4.34.14.54.24.74.24.94.94NaN 44.74.44.84.74.64.54.14.34.54.84.34.64.24.64.6NaN 4.24.74.24.74.34.34.74.94.444.14.444.54.54.84.14.84.14.34.23.83.64.944.7NaN 4.94.74.54.84.24.83.8NaN 3.83.64.24.34.144.44.24.844.744.84.54.34.54.7NaN 44.44.33.64.34.74.53.84.14.94.44.84.2NaN 4.34.14.24.94.94.6NaN 4.84.54.74.6NaN 4.84.644.43.64.944.44.14.44.64.23.54.64.944.83.34.14.64.64.74.44.444.54.34.64.744.24.14.54.63.944.24.94.24.64.34.64.44.3NaN 4.84.3444.94.74.74.24.43.64.34.34.14.74.44.64.74.44.64.74.44.43.83.84.54.64.63.64.94.14.24.5NaN 44.14.24.64.24.14.944.64.34.24.94.54.34.14.14.24.23.94.84.74.24.94.44.94.244.14.354.14.64.34.943.74.44.54.13.54NaN 4.84.2NaN 4.44.63.244.94.64.5NaN 4.93.744.24.84.73.54.94.64.94.94.64.44.64.644.14.64.14.64.34.24.84.44.74.844.23.8NaN 4.14.8NaN 4.24.83.74.14.24.74.14.44.44.84.32.94.34.144.44.83.44.24.34.74.34.14.24.44.54.84.34.54.8NaN 4.34.24.743.64.34.64.14.84.14.554.74.14.84.94.14.14.54.64.14.74.74.14.34.44.74.44.83.53.64.64.54.14.34.24.54.44.34.34.33.644.22.5NaN 4.54.74.44.64.24.94.14.54.744.64.14.24.14.14.14.14.64.9NaN 44.54.84.64.44.84.44.14.354.24.2544.74.74.23.54.14.14.53.54.74.44.34.64.73.74.94.64.14.2NaN 4.444.14.64.24.23.74.14.64.94.74.44.23.43.64.34.44.24.43.84.94.34.84.74.14.94NaN 4.44.94.74.54.84.74.24.14.13.54.54.73.23.64.44.54.24.54.34.74.14.654.544.34.14.24.34.24.14.13.64.24.24.44.64.14.44.14.44.54.3NaN NaN 4.74.64.744.344.44.84.84.34.54.74.44.14.254.754.14.84.154.54.943.54.54.13.64.64.444.64.34.34.73.64.44.74.14.24.144.14.14.244.24.64.64.44.84.454.34.94.34.44.44.23.54.354.9NaN NaN 4.64.54.24.74.94.64.23.9NaN 4.344.94.74.24.94.64.53.64.134.74.64.24.24.64.34.13.94.74.53.72.64.8454.34.64.34.54.54.94.24.24.64.23.94.14.454.44.64.654.83.84.44.64.54.23.94.64.44.444.6NaN 4.44.64.84.14.7NaN 4.844.644.44.84.34.74.24.84.84.74.24.24.84.24.44.13.74.74.74.354.84.73.754.344.44.64.14.24.444.34.64.74.53.84.24.64.54.13.94.84.34.4NaN 4.44.23.53.54.34.14.24.44.444.94.34.94.444.84.54.64.84.34.5NaN NaN 4.64.54.14.94.244.84.444.64.213.654.54.74.54.34.34.8544.74.3NaN 4.1NaN 54.24.63.74.64.74.43.9NaN 4.23.54.74.34.24.54.64.94.954.44.34.14.94.83.54.74.74.74.64.94.644.14.943.744.44.24.14.64.24.64.94.44.744.54.63.14.244.34.83.5NaN 4.44.24.12.73.13.34.94.74.74.44.94.54.44.44.34.14.14.24.44.14.34.44.73.14.43.74.34.8NaN 4.342.73.84.64.13.63.64.44.34.14.14.14.74.6NaN 4.3NaN 4.24.54.54.54.34.8NaN 3.8544.74.74.24.24.24.64.44.14.64.33.64.944.23.64.744.14.94.64.54.443.83.14.8NaN 4.14.14.64.2NaN 4.94.64.14.43.94.54.1NaN 3.63.74.84.63.74.34.54.5453.54.74.64.54NaN 44.144.14.74.63.94.6454.64.1NaN 3.64.53.54.74.73.74.64.64.14.14.44.84.443.24.53.54.24.54.24.53.84.64.74.23.24.34.34.43.94.44.74.24.94.14.13.74.54.83.64.34.24.144.24.74.64.54.444.34.64.44.244.44.7444.63.64.24.44.24.24.34.84.43.74.64.54.154.14.74.34.74.24.34.84.24.24.54.34.14.14.64.34.94.44.74.64.74.24.54.93.54.24.24.82.5NaN NaN 4.24.44.53.64.13.24.74.14.7NaN 4.34.24.354.34.84.654.44.74.74.14.83.93.543.64.94.144.44.14.74.84.64.64.84.84.443.74.644.14.44.74.84.94.24.84.14.2NaN 4.44.9NaN 4.14.74.84.14.24.14.6544.24.44.34.94.44.94.64.64.84.4554.94.64.44.33.64.34.24.64.14.15544.84.34.64.84.5NaN 4.74.64.34.84.34.34.24.43.44.74.34.74.24.74.64.34.5444.34.44.54.64.34.43.94.64.544.444.54.24.24.14.94.84.74.6NaN 4.84.94.74.14.14.74.43.14.84.73.54.24.24.44.63.64.13.644.7NaN NaN 4.34.64.644.64.62.64.74.24.3NaN 4.94.754.44.74.33.74.54.74.13.64.54.14.34.64.44.34.94NaN 4.54.14.94.74.94.93.14.44.64.84.34.34.24.24.44.24.24.154.94.64.74.24.63.64.54.24.314.64.54.544.84.153.84.64.13.93.94.24.6NaN 4.34.34.54.34.24.44.14.84.44.144.14.54.63.74.84.44.24.14.24.144.24.74.24.34.83.54.34.54.64.94.1NaN 4.94.72.74.44.24.24.44.94.34.24.63.54.13.64.34.644.34.244.34.64.84.84.44.1NaN 4.74.744.64.94.73.43.554.14.254.84.64.84.74.353.94.32.93.5NaN 4.64.64.64.24.63.8NaN 4.34.5NaN 4.64.34.74.3NaN 4.84.24.44.84.44.14.84.44.64.43.94.643.63.23.94.34.94.44.5NaN 4.9NaN 4.34.24.44.74.74.64.64.14.554.64.64.24.44.34.24.844.23.95NaN 4.83.94.24.44.83.65544.64.14.24.64.44.54.14.14.84.84.954.644.84.7554.64.14.553.74.44.84.33.74.74.73.64.64.95NaN 4.64.64.44.544.954.93.74.63.84.14.14.44.14.444.14.24.34.454.94.34.53.54.14.64.144.34.34.74.64.74.23.84.84.6NaN 4.14.84.13.54.14.14.354.13.54.43.54.14.63.54.24.43.34.94.74.64.54.64.14.254.64.84.14.24.64.83.24.34.83.74.73.94.44.54.94.94.74.33.84.64.14.454.2554.84.14.14.1NaN 4.84.94.44.243.94.94.84.244.74.84.14.14.54.74.14.14.84.64.24.44.84.13.952.74.83.5415NaN 4.14.92.94.74.84.84.144.64.2NaN 4.14.64.14.24.24.14.94.244.24.54.34.43.24.44.13.53.44.74.84.54.74.5NaN 54.34.24.24.74NaN 4.744.54.544.44.64.34.4NaN 4.54.84.6NaN 3.74.24.54.24.34.84.754.64.64.53.64.64.14.74.44.64.14.34.14.2NaN 4.74.64.24.14.84.33.74.74.354.24.53.94.64.9543.8NaN 4.6544.24.34.64NaN 4.13.544.24.744.6NaN 4.6NaN 54.74.74.94.33.84.34.54.33.73.64.34.94.63.44.84.74.143.82.54.24.34.54.44.74.34.44.84.84.83.54.54.84.44.84.14.64.44.54.34.443.7NaN 4.64.64.44.34.24.444.44.44.24.44.43.854.44.84.24.244.54.2NaN 4.94.84.64.84.64.94.74.94.44.44.24.1NaN 43.64.44.64.24.64.14.844.23.844.24.54.54.244.64.64.84.84.74.84.644.34.54.2NaN 4.14.44.14.54.84.3NaN 4.64.14.64.14.254.84.24.54.32.84.44.154.34.82.644.14.34.14.64NaN 5NaN 4.44.143.74.144.33.54NaN 43.64.53.93.74.14.644.94.94.34.54.644.34.344.64.94.24.44.34.2NaN 4.24.33.74.34.44.54.843.744.74.33.93.94.14.84.84.94.44.14.34.74.144.54.14.4NaN 4.44.24.14.1544.83.844.64.44.4NaN 4.354.43.64.34.94.74.74.83.64.654.34.14.64.63.63.84.54.64.14.24.24.23.74.454.64.44.1NaN NaN 4.34.43.94.74.44.63.84.74.94.14.43.54.34.94.24.24.24.14.64.34.14.94.64.74.74.84.34.5NaN 4.34NaN 4.64.8NaN 4.84.74.43.64.63.84.23.43.84.24.64.14.44.644.44.74.14.14.34.74.83.854.954.84.653.54.14.34.24.64.24.34.554.14.44.84.24.444.14.54.64.34.34.24.94.94.14.844.64.74.2NaN 4.24.64.74.74.24.24.444.64.443.54.853.84.84.64.144.14.44.13.74.84.74.74.24.64.14.14.94.94.34.544.54.1NaN 54.14.64.84.83.64.64.44.14.24.34.74.74.14.24.6444.644.34.44.84.34.34.24.944.14.34.34.144.64.54.74.33.64.14.2NaN 3.74.94.74.24.64.1NaN 4.34.14.64.64.44.64.44.74.44.644.34.14.24.34.24.24.24.44.64.94.14.74.24.744.54.84.84.94.454.244.14.44.84.24.44.14.14.54.23.54.94.43.64.73.64.64.24.54.23.654.54.14.43.84.24.74.44.244.24.44.64.84.44.44.54.94.94.74.14.34.34.54.23.84.64.13.54.34.54.83.94.54.24.44.44.54.34.34.74.64.64.24.644.34.94.64.53.74.14.14.84.74.24.94.64.14.44.6544.34.244.74.63.544.64.93.74.64.74.64.44.24.83.7NaN 4.553.74.13.94.844.64.5544.14.74.24.24.63.54.43.54.8NaN 4.244.254.34544.24.34.24.24.34.14.34.34.74.94.84.64.74.3NaN 4.34.144.24.643.95NaN 4.74.13.44.34.64.944.63.93.754.14.34.54.34.144.64.1NaN 4.14.64.74.43.8444.24.44.444.74.444.3NaN 4.64.84.14.84.24.244.94.63.54.94.24.63.64.14.83.844.154.24.43.74.94.34.24.54.14.34.94.24.2454.64.34.54.84.24.74.74.3NaN 4.23.74.24.14.43.74.44.64.44.64.14.74.844.34.34.33.84.64.14.14.34.14.34.64.34.24.454.444.1444.43.74.24.44.34.7NaN 4.254.74.64.5144.14.44.34.6NaN 3.644.74.64.54.24.44.43.24.754.64.254.6NaN 4.24.4442.84.54.154.64.14.94.94.44.844.64.64.74.84.44.64.94.844.14.14.54.84.44.9NaN 44.44.24.14.244.24.84.94.254.54.64.74.34.34.944.14.34.24.54.6NaN 43.54.63.74.84.74.33.54.7444.14.954.544.24.63.64.64.644.73.64.63.9NaN 4.14.54.44.64.34.7444.3NaN 3.94.14.64.24.14.54.444.14.44.24.8NaN 4.44.14.34.84.64.94.14.74.9NaN 4.34.84.944.44.453.94.9NaN 3.94.24.14.34.64.14.84.74.63.84.44.74.14.63.64.24.74.24.14.14.73.84.14.24.34.154.44.73.754.14.34.74.64.34.94.44.44.64.954.64.44.34.74.34.64.154.614.14.64.64.24.24.94.54.53.14.84.63.74.94.44.54.93.64.43.64.14.74.24.3NaN 4.34.744.64.74.44.94.64.33.54.644.54.34.53.813.84.14.74.64.54.344.14.13.84.63.54.14.44.5NaN 4.84.74.13.93.64.74.64.44.44.74.44.44.53.84.14.43.544.54.53.83.24.44.34.144.44.94.14.24.14.64.64.24.24.74.743.53.754.14.24.64.33.14.64.8NaN 4.34.14.24.84.14.84.44.24.74.74.63.5NaN 4.34.44.83.84.33.444.24.94.74.84.74.44.84.3NaN 4.24.83.94.34.44.54.44.34.24.64.24.244.2NaN 4.54.914.34.94.74.74NaN 4.54.1444.54.2NaN 44.844.54.84.3NaN 4.34.34.74.34.34.33.84.54.44.444.14.74.94.24.24.74.24.653.64.44.14.63.94.143.53.94.84.444.74.23.74.62.74.644.353.74.54.24.34.44.33.7NaN 4.14.64.94.64.74.34.74.54.24.83.54.7NaN 4.64.94.44.644.4NaN 44.64.34.744.54.43.94.34.24.74.84.64.84.54.14.954.34.44NaN 4.54.34.24.64.244.24.94.24.64.24.64.64.84.743.84.24.84.14.84.74.33.93.84.644.4NaN 4.94.54.94.944.34.64.744.2NaN 4.54.63.84.44.444.44.44.24.13.64.24.24.44.14.54.14.14.954.454.74.34.64.34.13.54.94.64.644.14.34.1NaN 4.144.34.84.24.74.84.24.94.2NaN 4.44.74.24.44.44.84.14.644.54.854.84.74.14.14.24.34.53.84.844.64.144.344.54.34.6NaN 42.74.34.34.34.44.144.94.84.74.64.74.84.74.24.34.54.444.84444.44.84.73.24.24.244.24.44.74.94.84.84.14.44.74.24.7NaN 4.34.34.94.24.73.64.54.3NaN 4.53.94.94.34.1NaN 44.64.63.7554.44.24.53.83.654.344.34.64.84.1444.94.44.44.44.24.34.24.853.74.84.3NaN 54.94.44.14.24.34.34.3NaN 4.24.33.93.94.64.34.444.74.54.844.54.53.83.54.754.3NaN 4.63.64.34.344.44.63.74.44.14.14.844.14.43.14.644.34.24.73.94.64.14.84.74.14.83.94.64.54.644.244.84.14.34.34.34.54.24.44.34.34.23.54.34.94.44.24.34.94.94.94.54.54.24.64.14.554.44.24.84.34.444.44.4NaN NaN 4.744.4NaN 4.24.44.54.64.14.74.94.74.54.24.64.44.24.654.73.74.34.84.94.94.644NaN NaN 4.44.74.34.5NaN 4.35NaN 4.14.14.64.74.14.74.64.54.14.84.64.94.644.84.24.34.64.64.2NaN 4.144.43.34.14.64.24.94.14.44.24.154.14.94.234.14.24.54.64.33.5NaN 3.74.44.13.83.74.34.44.14.24.84.34.74.64.244.74.64.354.33.84.24.44.244.34.84.84.64.24.64.24.544.84.12.53.9NaN 4.254.44.24.1444.54.24.24.34.64.254.83.64.24.2NaN 553.74.94.24.34.14.34.14.6NaN 4.64.34.84.5NaN 3.74.14.13.83.64.14.13.54.15NaN 4.54.23.54.34.94.654.34.74.64.84.24.64.43.54.944.43.74.544.8NaN 4.74.74.64.94.74.44.44.13.92.84.84.44.74.53.54.34.14.43.74.74.94.23.14.24.54.14.44.43.744.84.544.34.73.83.74.24.14.54.44.43.94.644.54.44.34.24.74.944.14.64.644.644.14.34.34.94.14.73.54NaN 4.64.24NaN 4.24.34.73.54.24.14.94.34.34.13.84.1NaN 4.74.53.84.64.24.33.64.73.64.13.94.14.34.54.33.8NaN 4.654.14.74.74.64.453.54.13.83.54.24.544.24.6NaN 2.93.84.44.44.54.24.24.23.24.24.34.64.43.34.644.84.14.64.94.64.9NaN 4.23.54.554.74.94.84.444.24.844.64.44.34.64.1NaN 4.844.43.63.5454.64.34.64.54.94.74.64.44.84.14.14.14.444.94.94.63.94.64.84.144.4444.4NaN 4.14.64.74.74.344.44.8NaN 4.84.2NaN 4.73.64.74.44.94.14.44.94.854.34.954.34.944.23.73.64.53.54.94.64.344.24.54.33.14.74.14.24.34.53.64.34.44.754.54.754.33.84.6NaN 4.44.14.34.34.64.93.84.84.444.14.84.64.544.23.64.54.64.74.9444.34.34.54.64.34.24.63.94.6NaN 4.84.54.34.74.54.44.14.64.54.64.34.14.93.94.454.44.63.954.54.44.64.14.34.44.64.13.644.24.24.94.84.3NaN 4.34.34.24.754.74.23.83.74.54.93.744.34.44.644.94.35534.84.23.44.14.94.64.7NaN 4.33.74.44.94.24.44.944.14.54.34.14.94.64.13.64.44.34.644.34.34.54.34.14.2NaN 4.64.24.44.34.7NaN 4.84.74.5NaN 4.94.94.144.14.54.14.44.94.74.64.12.74.744.64.14.24.44.14.64.93.54.1NaN 4.64.54.64.954.44.84.54.34.14.84.84.24.24.84.24.84.74.644.54.64.64.34.44.14.44.14.54.24.44.74.44.93.84.63.54.14.14.64.34.244.24.14.44.84.24.84.23.94.93.84.83.93.84.954.64.84.73.84.64.944.24.64.244.94.64.24.34.54.74.93.53.7NaN 43.23.44.64.84.34.24.4NaN 44.44.344.2NaN 4.44.94.84.84.64.4NaN 4.34.2NaN 4.644.7NaN 4.84.24.64.14.13.54.74.43.64.24.34.14.74.34.33.64.64.34.34.84.44.94.73.84.34.74.24.54.24.644.94.14.44.9444.34.74.54.844.14.44.14.94.844.354.74.72.54.14.14.54.44.44.64.64.74.14.73.94.73.84.44.24.34.24.94.74.54.34.244.24.64.64.34.54.44.64.44.34.33.74.94.144.74.74.654.84.14.14.74.14.644.34.14.744.344.14.24.44.5NaN 4.654.74.64.64.64.24.24.94.84.24.644.64.14.34.14.44.64.64.34.34.74.64.13.84.94.24.14.74.34.34.44.344.74.14.64.54.83.83.63.54.43.754.54.54.344.23.53.34.84.24.84.244.44.54.14.14.74.44.94.8NaN 3.84.14.74.24.44.34.33.64.64.44.14.74.43.74.84.44.844.64.144.64.64.614444.13.54.64.53.94.64.24.654.13.24.14.24.9NaN 4NaN 4NaN 3.82.944.54.82.74.14.14.94.154.14.64.64.24.34.33.84.84.454.34.944.74.84.4NaN 4.644.14.44.74.24.74.8NaN 3.94.34.34.14.344.14.94.34.84.54.74.64.94.53.54.854.44.54.53.74.24.34.24.24.24.144.74.22.74.64.63.94.154.344.34.644.74.653.82.643.44.14.24.94.2544.24.64.44.23.34.744.24.33.54.74.14.8444.54.14.64.34.64.64.14.64.14.44.54.14.14.4454.44.84.84.63.74.74.153.94.44.74.24.44NaN 4.64.64.44444.14.94.32.8NaN 4.44.63.83.64.14.14.64.33.84.24.44.24.34.344.14.54.94.14.84.94.34.7444.24.23.544.34.52.84.14.34.24.743.54.14.94.14.44.83.94.444.44.14.64.74.34.644.64.74.24.14.54.14.14.754.1NaN 4.843.24.34.74.64.44.54.74.94.14.443.74.74.94.54.14.64.84.23.74.34.44.944.84.63.54.64.74.1NaN 4.24.14.74.34.24.14.14.14.14.63.5NaN 4.44.14.44.64.64.54.64.13.14.64.13.63.84.44.144.14.84.54.24.84.84.74.64.34.23.7454.84.13.74.33.64.644.64.34.24.64.54.14.34.94.84.14.64.44.44.24.54.34.23.44.74.34.53.74.14.64554.84.14.744.74.74.2NaN 4.24.23.7444.94.344.444.34.64.84.93.54NaN 4.14.24.74.94.24.44.74.24.84.74.3NaN 4.84.44.73.54.54.13.94.644.544.24.543.94.34.44.14.14.24.34.24.54.74.954.254.34.144.444.34.44.444.94.54.74.344.854.44.144.84.84.944.14.24.14.94.44.6NaN 4.64.64.64.24.34.14.82.84.44.73.64.64.54.74.33.94.14.353.944.64.24.64.64.14.94.44.954.14.84.74.74.34.83.84.63.93.54.54.23.64.24.44.54.154.94.54.74.64.34.14.54.64.354.64.44.74.3154.14.34.64.34.544.24.4NaN 53.14.24.2NaN 4.83.94.74.23.94.64.83.34.34.654.14.54.14.93.6NaN 4.754.24.54.64.44.84.85NaN 4.24.14.94.34.34.644.34.94.44.73.84.854.6NaN 3.84.84.54.64.64.6NaN 4.63.54.944.24.14.744.74.74.74.64.24.24.23.54.74.44.14.63.74.34.24.54.74.34.54.8NaN 4.83.64.4NaN 4.24.14.24.94.63.94.74.72.84.64.24.654.64.63.53.5NaN 4.84.614.34.34.14.34.14.64.94.34.64.64.14.1NaN 44.34.84.14.144.64.44.344.34.244.44.24.24.94.64.94.3NaN 4.24.94.24.24.844.84NaN 4.213.74.85NaN 4.24.74.3NaN 4.954.14.44.14.73.54.554.84.74.64.14.64.84.64.54.54.64.354.84.6444.74.24.13.6544.34.34.34.54.63.94.24.14.93.344.14.843.144.54.2NaN 4.14.74.84.44.74.14.9NaN 4.64.15444.34.34.64.64.34.8444.24.34.74.24.13.9NaN 4.344.34.94.84.94.8444.14.24.23.54.1453.54.34.53.74.64.74.642.64.34.64.34.82.64.33.74.64.93.64.24.1NaN 4.7NaN 4.24.94.454.34.44.24.944.14.44.14.644.8NaN 4.64.84.64.54.94.34.34.44.14.64.74.74.74.44.14.14.24.844.54.3NaN 4.9NaN 3.94.54.8444.44.14.74.34.74.32.54.854.34.34.34.34.14.24.64.1NaN 4.244.13.954.14.84.6544.944.74.14.94.8544.14.34.24.14.34.744.93.34.74.64.944.44.64.3454.54.34.84.24.83.554.34.44.24.24.74.14.14.44.34.84.14.74.54.64.3NaN 4.953.63.84.24.64.244.24.654.84.44.24.14.64.14.72.54.14.14.64.93.44.34.343.24.64.24.24.44.74.6NaN 44.83.74.94.84.24.6NaN 4.654.54.444.44.54.14.14.44.74.44.34.34.14.14.94.34.14.54.63.54.64.74.14.73.94NaN 4.34.74.44.74.54.74.44.24.14.343.84.24.14.14.644.24.14.24.64.5NaN 4.74.74.44.84.14.24.64.14.344.84.64.64.544.54.74.744.84.74.54.54.84.94.14.64.74.84.744.95NaN 4.74444.72.84.94.14.34.94.24.84.33.64.84.64.74.24.34.74.844.24.14.63.944.63.54.74.94.44.34.84.13.94.44.14.64.24.14.74.64.14.14.54.64.14.14.14.82.64.54.14.5NaN 4.84.64.24.64.24.94.24.24.64.84.14.64.14.44.44.14.44.14.74.24.93.34.84.44.43.54.64.84.84.74.13.64.64.84.44.94.24.54.74.94.44.73.94.74.644.44.14.14.64.14.54.74.24.34.644.44.64.54.24.154.94.24.24.74.94.14.93.63.644.754.454.7NaN 4.34.74.14.24.44.14.54.74.3NaN 4.63.74.34.74.344.54.64.74.54.74.84.44.63.74.14.144.24.93.644.34.74.14.24.14.44NaN 4.13.54.64.24.64.3554.14.9NaN 4.43.92.84.34.554.64.94.74.94.94.14.94.74.74.44.64.84.24.24.74.44.14.844.23.14.44.54.14.7NaN 4.44.52.6NaN 4.34.34.14.24.34.74.644.93.24.33.54.63.84.644.54.5NaN 4.643.94.94.44.54.64.24.94.14.14.23.74.24.63.9144.254.44.14.44.14.83.54.24.24.23.84.44.64.85NaN 44.454.244.3NaN 4.64.94.344.34NaN 44.8NaN 4.14.34.14.24.14.7NaN 4.24.34.73.244.34.34.64.444.34.84.14.654.64.64.33.554.24.144.24.14.34.353.74.33.743.54.24.94.54.63.64.44.44.44.94.84.94.14.74.74.94.74.64.84.1NaN 4.24.64.24.64.54.84.74.64.74.14.84.24.74.14.4NaN 4.64.14.43.53.54.44.954.24.93.64.54.84.64.74.34.44.74.54.24.44.144.2NaN 4.54.544.84.14.6NaN 4.34.84.34.74.53.64.94.344.64.44.34.74.34.44.84.254.34.63.54.24.34.644.14.74.24.94.254.54.83.83.94.63.54.64.34.64.94.84.1NaN 4.34.44.83.84.34.3NaN 4.53.844.93.64.24.554.24.944.454.64.74.44.34.24.354.64.64.24.44.4554.64.34.74.114.34.14.24.644.83.53.74.14.84.74.7454.24.54.854.74.44.34.64.72.544.74.73.84.34.63.64.34.344.344.74.443.343.54.7NaN 4.13.6444.84.44.94.53.9NaN 4.8NaN 4.74.34.64.44.94.94.64.14.34.64.64.63.644.54.64.24.14.64.914.444.95544.54.64.54.74.23.54.64.454.7NaN 4.854.4NaN 4.14.94NaN 4.14.24.14.144.94.854.454.654.44.12.74.24.64.64.64.54.94.93.5NaN 4.64.24.14.44.34.444.44.44.64.64.844.33.74.13.714.654.2NaN 4.54.64.14.63.64.44.64.94.14.34.54.94.1NaN 4.84.64.54.94.74.24.34.74.94.14.84.24.74.843.54.74.24.64.94.74.54.64.654.554.73.74.854.44.64.24.14.63.5544.64.44.44.14.44.333.74.14.54.744.74.44.24.5NaN 3.74.14.24.24.244.34.64.34.24.44.3NaN 4.73.54.64.24.44.2NaN 4.34.74.74.34.34.24.24.144.54.4NaN 4.34.84.644.44.74.84.7NaN 4.444.34.94.34.24.74.744.23.94.64.14.94.154.13.64.24.24.34.34.44.94.64.84.44.254.34.24.64.33.54.34.244.23.54.44.754.244.444.144.74.73.94.23.54.93.94.54.24.44.44.64.34.44.64.33.94.64.63.94.94.24.14.653.94.44.12.64.63.54.84.14.14.84.84.34.84.44.43.94NaN 4.64.54.94.22.84.3NaN 4.23.63.414.74.1454.54.24.3NaN 14.24.454.44.13.53.54.64.94.34.84.64.54.14.44.74.14.353.64.142.94.34.14.34.63.64.44.14.33.84.7NaN 4.4NaN 4.64.44.14.14.74.34.644.54.82.94.14.6NaN 4.744.144.94.44.94.24.74.64.244.14.14.1NaN 4.74.34.84.44.94.244.34.93.64.34.44.44.24.14.64.64.94.24.44.34.14.74.24.94.14.34.64.14.54.93.6454.24.74.5NaN 4.64.344.34.64.23.64.2NaN 4.54.54.64.154.3554.34.954.74.24.74.84.33.64.344.54.14.24.53.544.34.7NaN 4.14.84.24.44.74.94.444.84.44.2NaN 4.23.344.74.64.14.94.54.64.64.74.64.14.64.64.34.74.14.94.14.74.24.14.14.8NaN 44.64.64.44.64.744.34.64.64.34.44.94.954.244.64.84.64.34.853.74.64.34.53.5NaN 4.644.44.44NaN 4.754.44.24.1NaN 4.3NaN 4.24.34.3NaN 4.14.34.74.34.44.64.43.84.94.24.34.44.24.54.64.94.64.44.64.84.34.954.34.74.84.54.94.64.84.63.64.93.64.24.64NaN 4.53.6NaN 4.154.74.44.24.944.64.83.74.344.54.34.44.4444.14.74.84.54.34.64.74.94.94.243.64.14.44.64.64.544.24.64.74.64.94.24.24.74.44.34.14.8NaN 4.23.24.34.64.44.73.94.144.34.64.14.14.23.64.14.54.34.23.84.14.83.74.63.84.944.34.1NaN 4.54.64.254.64.253.94.24.14.7NaN 4.14.24.33.74.9NaN 4.64.3NaN 4.554.644.64.54.54.34.23.84.34.44.84.64.74.24.33.83.54.12.53.94.34.24.14.6NaN 4.73.74.3NaN 3.93.54.74.14.1NaN 4.14.4NaN 4.14.74.744.94.33.74.14.34.654.2NaN 4.44.254.814.344.94.13.74.74.54.24.24.24.74.54.15NaN 4.94.64.54.34.94.84.64.44.14.64.84.454.54.44.84.44.43.24.34.84.54.94.444.14.2NaN 4.54.84.644.93.34.33.73.54.14.14.14.24.23.54.64.14.34.74.24.34.74.14.54.24.44.94.83.34.74.64.84.64.43.84.83.54.44.24.544444.643.94.6NaN 4.13.744.14.654.14.24.34.84.3NaN 4.24.84.54.14.43.84.34.44.44.64.543.64.33.644.74.64.44.63.84.14.944.34.74.74.3NaN 4.64.64.34.74.83.54.34.34.34.94.54.444.94.64.23.84.84.64.74.954.33.54.34.54.54.644.14.24.63.84.54.44.44.6NaN 4.24.24.44.24.23.74.94.754.14.6NaN 4.44.44.54.654.24.53.54.14.83.543.54.94.44.33.7NaN 4.84.444.34.84.14.34.14.34.44.84.44.24.34.44.34.34.24.5NaN 4.34.6NaN 4.93.74.74.443.954NaN 4.14.753.94.6444.24NaN 3.94.64.34.44.74.4NaN 3.84.24.14.34.74.14.84.34.34.64.24.94.34.744.54.14.44.24.84.34.14.73.74.24.64.8NaN 54.53.64.14.14.74.74.64.12.94.1454.84.64.24.13.84.14.34.94.34.454.73.83.73.63.6454.94.74.94.14.24.74.94.24.14NaN 3.24.1NaN NaN 4.34.54.94.64.74.24.13.94.14.34.644.2NaN 4.34.74.34.84NaN 44.84.74.34.43.94.24.14.54.64.44.14.34.24.94.93.54.53.74.84.44.64.6NaN 4.84.543.44.34.14.844.14.64.554.74.64.44.24.24.24.74.34.94.843.73.84.84.54.74.34.74.94.1NaN 4.64.94.244.63.73.53.143.83.84.33.74.44.74.94.244.94.7NaN 4.1NaN 4.44.844.914.34NaN 4.94.33.84.94.44.74.9NaN 3.84.744.84.84NaN 4.24.94.63.84.44.24.84.14.64.24.64.84.34.24.14.74.83.7NaN 4.23.94.84.644.844.64.14.554.744.74.943.84.14.64.6544.8NaN 4.84.44.44.24.84.54.24.944.1444.5NaN 4.14.64.34.24.54.44.64.44.24.444.23.544.14.84.54.74.14.84.54.23.53.83.84.84.734.33.94.94.644.24.44.84.94.13.7NaN NaN 4.64.14.14.34.74.43.54.44.14.34.64.353.74.64.54.14.93.94.84.23.744.24.3NaN 4.24.44.23.74.64.64.94.84.74.14.24.84.94.64.14.14.54.44.854.243.944.74.344.54.73.34.54.24.84.8NaN 4.754.34.24.54.34.44.73.5444.34.14.23.94.24.63.74.6NaN NaN 4.24.94.34.73.544.54.514.94.153.84.14.84.64NaN 4.54.34.84.64.44.74.14.63.74.14.13.94.44.74.14.24.14.73.84.84.14.44.64.24.64.42.54.34.14.84.44.44.654.34.34.54.43.644.744.24.54.73.74.43.94.73.94.54.84.24.64.54.14.944.84.74.4NaN 4.24.7NaN 4.33.14.844.64.64.14.23.84.63.84.44.53.84.13.8NaN 4.44.4NaN 4.944.14.74.13.84.43.94.63.83.54.34.24.24.5544.54.74.14.14.64.34.24.14.14.7NaN 4.84.24.14.74.64NaN 3.74.34.24.34.34.24.94.43.84.2NaN 44.244.14.34.14.94.93.84.64.13.644.34.6NaN 4.2NaN 44.34.644.74.13.73.654.54.34.14.84.3NaN 3.64.844.53.64.444.744.24.44.644.43.54.24.33.754.84.64.24.34.54.54.644.84.654.34.154.24.44.64.14.94.8NaN 3.64.84.34.53.54.64.64.1NaN 4.44.84.344.34.44.244.24.253.84.14.93.64.74.3NaN 4.74.63.54.73.74.84.74.14.64.254.94.84.64.43.94.23.94.34.44.14.54.94.34.84.54.24.14.3NaN 4.43.84.64.25NaN 4.54.14.33.64.44.3NaN 3.54.73.844.84.24.144.34.844.74.24.64.14.64.14.43.954.754.34.42.54.64.44.94.344.14.94.454.24.23.84.64.24NaN 4.44.64.53.93.74.24.34.7NaN 4.34.54.144.24.44.14.74.14.64.514.74.44.64.444.44.74.654.33.54.44.44.74.84.14.24.644.254.44.24.14.24.6NaN 4.24.63.64.74.22.6444.24.14.64.44.34.74.44.84.6NaN 4.64.54.73.64.354.63.84.44.1544.44.74.63.54.254.353.64.64.644.14.44.34.84.14.54.14.63.94.84.854.73.64.43.74.24.14.24.34.23.84.34.44.14.74.44.14.3NaN 4.74.44.33.84.24.944.74.64.64.1444.84.34.33.54NaN 4.73.74.64.944.74.5NaN 3.74.14.344.34.44.54.72.944.24.44.94.33.94.34.44.54.24.64.24.44.44.34.94.24.83.73.34.2NaN 4.34.34.43.54.64.64.24.34.74.42.84.64.84.43.74.54.44.543.84.2NaN 4.74.94.54.44.63.553.83.7NaN 4.6NaN 4.63.544.654.34.84.64.64.64.74.44.23.84.44.34.9NaN 44.84.14.54.94.154.34.24.14.44.94.94.84.63.94.24.13.544.643.83.64.74.73.83.64.544.54.34.24.14.23.14.24.9544.74.94.54.64.94.14.544.1NaN 4.54.44.14.34.74.84.23.74.64.24.144.44.24.63.93.54.34.74.74.84.74.73.84.854.94.14.943.54.34.24.54.64.74.84.64.84.44.64.34.554.744.14.64.64.3NaN 4.13.94.643.94.34.24.74.23.643.84.14.64.84.34.63.54.34.12.84.2NaN 4.74.44.14.34.74.64.33.84.34.84.654.644.63.94.24.6444.14.74.84.3NaN 4.84.24.84.24.23.24.84.44.554.24.34.54.54.24.24.24.24.74.64.64.44.444.24.24.14.34.64.14.74.74.24.63.84.1NaN 4.14.93.74.33.84.24.53.64.14.14.34.44.7544.24.24.34.24.54.64.64.53.6554.74.64.44.84.24.84.24.14.34.33.72.74.84.34.14.64.24.34.34.84.74.24.14.84.74.14.34.144.44.24.44.44.94.34.54.84.43.64.54.52.74.64.74.54.454.84.44.74.244.54.33.6NaN 4.24.443.74.44.14.34.23.84.14.23.82.814.74NaN 4.94.444.1NaN 4.154.64.94.34.24.13.54.6NaN 4.74.84.152.64.34.44.34.84.64.14.44.44.34.24.64.54.64.74.454.64.64.444.34.54.84.74.94.83.83.543.644.64.83.64.14.44.1NaN 4.54.84.7NaN 3.844.34.14.14.54.54.54.93.84.54.14.144.34.44.44.84.44.64.14.13.64.64.84.44.34.64.24.54.44.63.54.94.54.34.34.44.7553.74.24.154.2544.74.354.64.64.64.14.34.44.63.64.34.73.64.64.64.844.94.64.544.754.14.14.14.64.944.14.14.84.4NaN 3.554.74.84.84.64.44.33.24.23.74.85NaN 4.44.654.14.33.84.14.64.74.24.74.24.94.84.74.44.24.24.63.743.74.73.64.74.44.54.34.44.9NaN 4.43.94.444.14.84.24.84.14.64.24.64.44.84.74.24.1NaN 4.84.24.64.44.14.34.82.54.34.1NaN 4.6NaN 4.64.83.944.94.244.34.74.6NaN 4.34.24.34.343.54.74.84.854.83.94.34.44.14.74.44.53.34.24.34.64.54.64.23.643.54.84.34.14.24.244.34.74.24.64.44.74.14.94.94.64.13.83.54.94.34.24.44.34.64.54.8NaN 4.63.94.44.34.43.754.3444.34.24.54.84.94.54.33.84.63.74.654.514.64.34.84.74NaN 4.74.944.24.23.84.64.24.6NaN 3.54.13.54.44.54.34.74.23.74.14.74.94.74.3544.73.754.244.74.54.24.54.44.14.14.73.74.74.84.24.854.94.83.74.84.74.54.24.64554.34NaN 54.84.53.94.63.84.94.64.74.34.74.14.24.14.14.74.34.34.73.654.64.52.94.44.54.6544.24.22.64.54.14.74.94.64.74.84.74.744.64.24.8NaN 4.33.74.844.94.1544.14.743.94.84.644.64.42.84.84.33.73.84.34.84.74.54.14.34.254.63.94.853.54.94.64.24.644.954.74.14.34.54.24.454.94.24.62.54.14.74.54.24.24.44.54.14.44.14.84.24.14.33.644.94.74.24.14.644.14.64.64.454.14.944.944.63.74.14.14.54.24.44.93.54.34.94.73.1NaN 4.14.14.654.34.44.24.34544.54.44.64.954.74.444.74.24.84.23.54.73.64.44.34.44.24.94.64.14.63.14.44.64.54.654.24.93.84.84.34NaN 4.64.6454.34.844.244.14.64.34.94.844.74.14.2NaN 4.94.34.14.13.84.74.84.44.74.23.74.64.23.64.14.744.34.44.144.54.6NaN 4.13.54.14.24.83.84.144.24.94.64.83.74.754.14.94.14.34.14.24.14.74.34.24.23.94.74.74.44.73.54.54.24.3NaN NaN 4.34.4NaN 4.24.14.844.54.94.92.74.33.74.44.74.34.44.14.84.64.54.24.74.74.24.654.44.43.54.14.14.34.94.54.93.64.43.73.843.94.64.44.84.24.14.14.43.64.54.54.34.14.64.14.74.64.34.14.34.73.54.34.74.7444.63.54.24.24.84.82.84.54.7NaN NaN 4.2544.34.24.22.84.44.1NaN 43.44.254.24.34.64.94.13.64.94.92.92.64.13.5NaN 4.553.753.64.14.644.644.12.54NaN 4.9NaN 44.64.14.34.44.854.54.34.73.73.64.34.44.64.14.13.54.74.84.5NaN 3.53.74.3NaN 4.6544.84.64.64.53.94.14.74.24.33.64.74.84.14.9NaN 4.54.84.74.644.54.64.84.24.84.74.744.2NaN 4.554.943.94.94.94.24.84.84.74.14.34.64.14.63.54.94.74.654.24.454.64.64.64.64.244.54.83.44.44.24.64.444.23.754.64.144.9NaN 4.44.144.14.44.14.84.64.34.24.74.44.34.54.34.34.64.74.44.84.44.64.84.64.94.34.84.34.44.14.94.74.54.14.64.93.84.64.34.74.64.34NaN 44.34.34.54.34.83.64.74.354.84.64.44.73.54.24.34.2NaN NaN 4.34.84.94.94.354.4NaN 4.34.253.54.64.44.24.14.13.84.24.54.22.93.73.73.64.14.24.7NaN 4.7444.24.34.254.54.3454.43.6NaN 4.44.14.24.14.54.6NaN 2.64.64.744.24.24.34.33.63.54.24.74.84.33.74.844.84.24.7NaN 4.74.84.94.64.73.5NaN 4.343.74.64.8NaN 4.24.54.64.34.84.74.14.9NaN 4.44.74.33.84.844.74.94.54.44.24.84.74.44.54.14.44.64.34.43.94.34.64.12.64.64.64.12.74.74444.24.54.14.74.14.14.14.24.553.54.454.14.3NaN 4.24.24.52.54.54.14.64.6NaN 4.73.7NaN 4.54.64.94.14.44.95NaN 4.44.144.64.64.7454.24.43.54.754.74.5NaN 4.74.74.84.6NaN 4.64.3NaN 4.34.94.14.4NaN 4.6NaN 4.24.34.13.54.243.94.63.43.54.944.14.254.43.9NaN 4.63.43.94.44.83.54.944.74.544.74.43.614.54.54.13.94.44.24.24.84.64.344.34.54.84.74.94.22.94.64.93.64.64.14.63.84.84.14.84.63.94.14.14.754.94.64.84.93.94.74.84.23.84.74.654.94.93.84.74.24.84.44.62.74.94.44.94.34.43.93.844.24.74.14.544.64.1NaN 4.24.94.83.544.14.354.74.94.1444.2NaN 3.74.74.34.24.14.14.54.2NaN 4.34.63.84.34.84.24.344.54.84.24.44.84.83.94.54.34.6NaN 3.64.944.23.8554.3NaN 4.94.354.44.54.1NaN 4.54.94.34.34.53.84.34.24.44.24.14.93.54.94.13.94.844.14.94.44.83.64.54.944.444.13.24.24.64.13.74.844.44.64.34.64.64.94.24.244.44.54.14.74.63.64.94.24.54.1NaN 4.64.74.144NaN 4.23.84.64.64.74.43.64.14.24.34.14.74.644.744.144.44.34.44.64.14.244.2NaN 4.65NaN NaN NaN 4.33.64.753.74.44.74.43.53.83.854.54.44.14.14.844.14.344.14.43.644.74.64.53.73.14.84.64.14.44.24.34.94.24.1NaN 4.14.84.14.83.24.84.24.94.254.74.74.14.64.94.44.84.34.84.64.24.84.44.94.44.14.8444.84.94.44.24.63.54.14.44.84.34.64.64.44.74.94.44.54.23.74.73.54.54.54.53.94.94.44.33.54.243.94.42.64.443.73.93.64.34.64.34.344.844.84.24.14.44.63.64.35443.84.644.53.14.24.64.44.94.84.64.14.84.64.13.74.94.94.14.2NaN 4.63.73.84.83.944.14.84.24.54.23.74.64.63.14.24.84.64.54.64.74.24.93.84.44.84.23.94.14.64.23.94.34.14.844.14.34.44.14.24.254.64.644.4NaN 4.34.94.84.64.34.14.24.14.64.84.34.24.74.34.34.94.33.94.854.34.44.74.74.64.74.64.94.64.14.84.84.3NaN 3.64.44.64.94.74.84.14.64.94.7NaN 3.44.74.24.95NaN 4.34.14.83.54.74.344.34.54.94.74.644.74.1NaN 4.54.74.44.14.74.64.9NaN 4.14.14.34.84.54.24.343.94.34.64.24.3NaN 4.554.744.64.34.344.34.63.54.42.94.3NaN 4.14.24.83.34.54.74.2NaN 44.24.54.24.44.654.84.74.24.23.73.74.63.74.34.74.1NaN 4.84.64.64.44.743.94.6NaN 4.74.64.54.44.54.24.74.244.34.54.24.24.54.854.34.63.84.44NaN 44.814.64.54.14.74.84.84.74.74.14.74.64.24.34.14.3543.74.5554.14.64.1NaN 53.84.14.74.143.64.94.3NaN 4.44.44.6NaN 4.54.8NaN 4.23.44.14.22.84.34.34.254.7NaN 4.44.64.44.73.83.54.34.854.14.24.84.64.44.94.454.94.13.64.344.44.54.944.34.64.54.84.144.64.64.64.64.14.754.34.64.13.64.14.34.644.24.63.74.74.344.84.33.64.84.14.14.14.34.34.14.24.34.54.44.94.64.54.14.93.54.744.944.944.144.84.73.74.54.14.44.5NaN 4.654.84.84.744.244.73.9NaN 4.74.54.24.64.1NaN 54.44.144.44.74.14.24.144.94.64.14.94.74.94.54.14.43.74.74.53.744.94.6NaN 4.94.64.14.64.94.64.9NaN 44.44.44.64.44.44.94.84.94.443.54.63.74.244.84.22.94.84.83.94.63.744.654.34.63.83.73.54.34.6NaN 4.64.84.34.3543.93.94.7NaN 54.74.64.54.64.94.74.23.84.44.74.74.844.44.85NaN 3.84.14.44.3NaN 434.74.64.74.244.64.14.24.34.63.94.74.644.33.74.44.94.84.23.754.64.23.9553.44.94NaN 4.14.24.94.84.13.84.64.14.34.83.94.54.54.13.84.14.34.84.24.13.54.34.44.44.84.4NaN NaN 4.64.13.844.94.93.74.94.94.64.24.24.64.44.243.64.24.34.84.64.94.44.54.54.84.14.64.6NaN 4.74.24.34.94.44.94.64.14.344NaN 4.34.34.64.24.444.24.34.64.34.94.64.34.64.64.24.64.9NaN NaN 4.454.94.54.14.94.64.34.14.14.24.34.94.544.354.34.54.24.94.34.34.84.64.644.94.44.844.74.64.64.44.34.3NaN 3.84.44.44.14.844.944.63.65453.34.64.34.8444.44.34.24.84.94.14NaN 4.74.14.74.24.44.34.24.54.74.454.64.14.24.94.13.74.34.94.54.44.744.64.63.444.43.54.24.24.84.954.24.24.24.14.74.24.34.64.34.94.24.14.14.74.64.73.94.34.54.44.144.34.74.843.84.44.64.24.83.94.244.24.244.24.44.94.94.64.34.94.34.24.74.64.24.24.84.24.14.654.6543.54.144.644.54.54.74.84.64.34.94.84.24.24.44.44.24.84.944.144.84.24.74.34.14.14.14.43.84.24.54.5NaN 4.644.74.14.74.8NaN 4.44.343.64.64.44.24.24.24.94.454.843.64.34.84.74.94NaN 4.344.44.44.6NaN NaN 44.53.54.74.54.44.64.3444.24.244.24.14.33.944.44.74.74.64.64.24.14.64.34.44.7NaN 3.44.74.64.14.23.74.64.73.7NaN 4.34.83.74.34.44.93.44.53.8NaN 4.34.754.14.33.83.74.44.14.24.34.14.8NaN 4.84.244.44.44.3NaN 3.244.34.643.4NaN 3.64.34.34.844.14.34.74.54.54.1NaN 4.34.44.24.44.154.14.65NaN 4.74.63.84.24.94.14.34.24.644.83.84.44.4NaN 4.74.53.7NaN 4.34.84.84.7NaN 4.54.34.84.14.64.94.44.63.64.84.34.34.44.354.24.33.54.9NaN NaN 4.343.64.12.94.74.64.23.64.93.74.74.84.24.24.24.64.754.254.34.24.64.74.24.54.44.14.44.24.14.13.84.54.244.1NaN 4.94.94.24.944.64.64.2NaN 4.54.94.64.14.44.94.24.64.74.44.34.64.44.54.64.44.54.354.14.34.44.244.84.64.34.74.24.44.34.63.94.24.654.13.54.44.43.644.24.14.154.54.44.24.14.34.54.74.84.74.54.84.34.44.94.14.414.64.34.54.34.24.62.74.63.7NaN 4.44.94.64.44.24.74.54.92.64.94.14.74.34.94.14.144.643.7NaN 4.23.54.54.344.14.64.14.944.84.44.13.63.74.84.24.64.94.54.34.24.24.62.74.54.54.2NaN 4.6NaN 4.34.83.54.65NaN 4.94.63.644.4NaN 4.74.344.64.34.14.53.94.44.64.63.34.6NaN 3.54.544.94.33.94.24.64.14.74.74.9443.944.14.24.94.44.64.3NaN 4.244.143.94.34.24.84514.23.64.24.644.24.84.74.34.74.14.64.754.24.2NaN 4.34.84.253.654.13.54.23.54.23.64.754.6NaN 4.24.3NaN NaN 4.64.7444.64.454.34.54.44.84.24.2NaN 4.74.64.13.84.44.93.544.44.34.944.34.14.543.43.64.554.64.24.64.14NaN 3.74.64.74.653.94.84.24.14.14.14.24.84.544.14.64.94.64.94.93.94.84.64.24.74.64.24.14.54.43.54.84.74.44.64.14.44.33.82.94.44.24.74.74.64.1NaN 4.44.74.34.2NaN 4.34.13.9NaN 2.744.53.43.8NaN 4.24.24.64.24.94.24.84.354.84.43.74.14.64.64.24.24.64.24.74.14.14.94.34.94.454.64.24.64.8NaN 4.94.9NaN 4.64.93.94.34.14.34.34.154.244.64.64.24.24.24.6' to numeric The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\32773\Desktop\外卖消费行为处理好的数据1\外卖消费行为处理好的数据\data mining.py", line 227, in <module> cluster_profile = data.groupby('Cluster')[cluster_features].mean() File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 2459, in mean result = self._cython_agg_general( "mean", alt=lambda x: Series(x, copy=False).mean(numeric_only=numeric_only), numeric_only=numeric_only, ) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 2005, in _cython_agg_general new_mgr = data.grouped_reduce(array_func) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\internals\managers.py", line 1488, in grouped_reduce applied = sb.apply(func) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\internals\blocks.py", line 395, in apply result = func(self.values, **kwargs) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 2002, in array_func result = self._agg_py_fallback(how, values, ndim=data.ndim, alt=alt) File "C:\Users\32773\.conda\envs\mining\Lib\site-packages\pandas\core\groupby\groupby.py", line 1948, in _agg_py_fallback raise type(err)(msg) from err TypeError: agg function failed [how->mean,dtype->object] 进程已结束,退出代码为 1 纠错
最新发布
11-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值