资源简介

2019年第十二届华中杯B题数学建模数据处理,博客地址为https://blog.csdn.net/ITxiaoangzai/article/details/89789496

资源截图

代码片段和文件信息

import pandas as pd
# 柱形图-折线图
from pyecharts import Bar Line Overlap
import numpy as np
import matplotlib.pyplot as plt


#统计每个区间的个数
def readExcel(x):
    shu_ju = []
    shang_xin = []
    for i in range(len(x[‘上新日销量‘])):
        shang_xin.append(x[‘上新日销量‘][i])
    shang_xin.sort()
    jian_ge = (max(shang_xin) - min(shang_xin))/10

    #第一季度
    # a1 = [];a2 = [];a3 = [];a4 = [];a5 = []
    # for i in range(len(x[‘上新日销量‘])):
    #     if x[‘上新日销量‘][i] >= shang_xin[0] and x[‘上新日销量‘][i] < shang_xin[0]  + jian_ge/5:
    #         a1.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge/5 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge/5*4:
    #         a2.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge/5*4 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge*2/3*2:
    #         a3.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge*2/3*2 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge*2:
    #         a4.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge*2 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge*10:
    #         a5.append(x[‘上新日销量‘][i])
    #
    # shu_ju.append(len(a1))
    # shu_ju.append(len(a2))
    # shu_ju.append(len(a3))
    # shu_ju.append(len(a4))
    # shu_ju.append(len(a5))

    #第二季度
    # a1 = [];a2 = [];a3 = [];a4 = []
    # a5 = [];a6 = [];a7 = []
    # for i in range(len(x[‘上新日销量‘])):
    #     if x[‘上新日销量‘][i] >= shang_xin[0] and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge / 5:
    #         a1.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge / 5 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge / 5 * 2:
    #         a2.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge / 5 * 2 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge / 5 * 3:
    #         a3.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge / 5 * 3 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge * 2 / 3 * 2:
    #         a4.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge * 2 / 3 * 2 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge * 2:
    #         a5.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge * 2 and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge * 3:
    #         a6.append(x[‘上新日销量‘][i])
    #     elif x[‘上新日销量‘][i] >= shang_xin[0] + jian_ge*3 and x[‘上新日销量‘][i] <= shang_xin[0] + jian_ge*10:
    #         a7.append(x[‘上新日销量‘][i])
    # shu_ju.append(len(a1))
    # shu_ju.append(len(a2))
    # shu_ju.append(len(a3))
    # shu_ju.append(len(a4))
    # shu_ju.append(len(a5))
    # shu_ju.append(len(a6))
    # shu_ju.append(len(a7))

    #第三季度
    a1 = [];a2 = [];a3 = [];a4 = []
    a5 = [];a6 = []
    for i in range(len(x[‘上新日销量‘])):
        if x[‘上新日销量‘][i] >= shang_xin[0] and x[‘上新日销量‘][i] < shang_xin[0] + jian_ge / 5:
            a1.append(x[‘上新日销量‘][i])

        elif x[‘上新日销量‘][i] >= shang_xin[0] + jian

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-05-04 16:58  my_hua_zhong_jian_mo\
     目录           0  2019-05-04 16:52  my_hua_zhong_jian_mo\.idea\
     文件         294  2019-05-02 08:16  my_hua_zhong_jian_mo\.idea\misc.xml
     文件         299  2019-05-02 08:16  my_hua_zhong_jian_mo\.idea\modules.xml
     文件         408  2019-05-02 08:16  my_hua_zhong_jian_mo\.idea\my_hua_zhong_jian_mo.iml
     文件       21766  2019-05-04 16:36  my_hua_zhong_jian_mo\.idea\workspace.xml
     目录           0  2019-05-04 16:52  my_hua_zhong_jian_mo\day\
     文件          61  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171111.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171112.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171113.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171114.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171115.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171116.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171117.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171118.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171119.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171120.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171121.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171122.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171123.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171124.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171125.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171126.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171127.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171128.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171129.csv
     文件          59  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171130.csv
     文件          58  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171201.csv
     文件          58  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171202.csv
     文件          58  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171203.csv
     文件          58  2019-05-02 09:45  my_hua_zhong_jian_mo\day\20171204.csv
............此处省略935个文件信息

评论

共有 条评论