pandaboy玩pandas
基于python的三方库pandas的excel表二次开发
import numpy as np
import pandas as pd
import time
from pandas import merge
import openpyxl
import datetime
Date = input('请输入日期:')
def html_to_excel():
with open(r'C:\Users\g\Desktop\CUX:缺件统计表_160618.xls','rb') as f:
df_o = pd.read_html(f.read())
print('数据表正在合并!')
bb = pd.ExcelWriter('F:\缺件表.xlsx')
df_o[0].to_excel(bb)
bb.close()
'''
1.删除掉订单类型是SO的产线且是13开头的数据,再定义SO为紧急要料
2.按物料、产线对实际缺件数求和,并输出所有行>>>df_inner1
'''
# df=pd.DataFrame(pd.read_excel('YC_扬柴主机缺.xlsx'))
# print(df)
# Url = 'C:\Users\g\Desktop\CUX:缺件统计表_140618.xlsx'
# Url = input('请输入文件名:')
def change_excel():
# df = pd.read_excel(r'C:\Users\g\Desktop\CUX:缺件统计表_150618.xlsx',sheet_name=0,header=7)
df = pd.read_excel('F:\缺件表.xlsx', sheet_name=0, header=8)
# df['需求日期'] = df['需求日期'].astype(str)
df['需求日期'] = pd.to_datetime(df['需求日期'], format='%Y-%m-%d %H:%M:%S',errors='coerce')
# print(df.head())
# print(df.info())
# df['产线'] = df['产线'].astype('object')
df1 = df[(~df['产线'].isin([130000007.0,130000001.0,130000002.0,130000003.0,130000005.0,130000021.0,130000022.0,130000023.0,130000024.0]))&(df['订单类型']=='SO')]
df2 = df[df['订单类型']!='SO']
df = df1.append(df2)
print('数据表合并已完成!')
#######################逻辑处理有问题,excel导出有问题########################
#######################以上BUG已经修复#########################################
df['产线'] = df['产线'].replace(130000001.0, '485装配线')
df['产线'] = df['产线'].replace(130000007.0, '随机附件')
df['产线'] = df['产线'].replace(130000002.0, '4102装配线')
df['产线'] = df['产线'].replace(130000003.0, 'VM装配线')
df['产线'] = df['产线'].replace(130000005.0, '整理线')
df['产线'] = df['产线'].replace(130000021.0, '二号厂装配线')
df['产线'] = df['产线'].replace(130000022.0, '二号厂试车线')
df['产线'] = df['产线'].replace(130000023.0, '二号厂成套线')
df['产线'] = df['产线'].replace(130000024.0, '二号厂随机附件')
df['产线'] = df['产线'].replace(130000600.0, '外协件销售出库')
df['产线'] = df['产线'].replace(930000001.0, '制造工程部')
df['产线'] = df['产线'].replace(930000002.0, '铸造厂')
df['产线'] = df['产线'].replace(930000003.0, '金加工厂')
df['产线'] = df['产线'].replace(930000004.0, '金加工厂机体线')
df['产线'] = df['产线'].replace(930000005.0, '装配厂')
df['产线'] = df['产线'].replace(930000006.0, '装配厂102线')
df['产线'] = df['产线'].replace(930000007.0, '装配厂85线')
df['产线'] = df['产线'].replace(930000008.0, '装配厂VM线')
df['产线'] = df['产线'].replace(930000009.0, '调试厂产线')
df['产线'] = df['产线'].replace(930000010.0, '调试厂生产')
df['产线'] = df['产线'].replace(930000011.0, '调试厂设修')
df['产线'] = df['产线'].replace(930000012.0, '质量部设修')
df['产线'] = df['产线'].replace(930000013.0, '质量部市场')
df['产线'] = df['产线'].replace(930000014.0, '质量部检验')
df['产线'] = df['产线'].replace(930000015.0, '技术中心')
df['产线'] = df['产线'].replace(930000016.0, '应用工程部')
df['产线'] = df['产线'].replace(930000017.0, '产品试验中心')
df['产线'] = df['产线'].replace(930000018.0, '平台开发')
df['产线'] = df['产线'].replace(930000019.0, '物流部')
df['产线'] = df['产线'].replace(930000020.0, '二号工厂机体加工线')
df['产线'] = df['产线'].replace(930000021.0, '二号工厂缸盖加工线')
df['产线'] = df['产线'].replace(930000022.0, '二号工厂装配线')
df['产线'] = df['产线'].replace(930000023.0, '二号工厂试车线')
df['产线'] = df['产线'].replace(930000024.0, '二号工厂成套线')
df['产线'] = df['产线'].replace(930000025.0, '二号工厂机体加工线设修')
df['产线'] = df['产线'].replace(930000026.0, '二号工厂缸盖加工线设修')
df['产线'] = df['产线'].replace(930000027.0, '二号工厂装配线设修')
df['产线'] = df['产线'].replace(930000028.0, '二号工厂试车线设修')
df['产线'] = df['产线'].replace(930000029.0, '二号工厂试车线生产工具')
df['产线'] = df['产线'].replace(930000030.0, '二号工厂成套线设修')
df['产线'] = df['产线'].replace(930000031.0, '调试厂校机维修')
df['产线'] = df['产线'].replace(930000032.0, '配件加工生产')
df['产线'] = df['产线'].replace(930000033.0, '材料、零部件让售')
df['产线'] = df['产线'].replace(930000034.0, '装配厂102线改型')
df['产线'] = df['产线'].replace(930000035.0, '装配厂85线改型')
df['产线'] = df['产线'].replace(930000036.0, '装配厂VM线改型')
df['产线'] = df['产线'].replace(930000037.0, '调试厂产线改型')
df['产线'] = df['产线'].replace(930000038.0, '二号工厂装配线改型')
df['产线'] = df['产线'].replace(930000039.0, '二号工厂试车线改型')
df['产线'] = df['产线'].replace(930000040.0, '二号工厂成套线改型')
df['产线'] = df['产线'].replace(930000041.0, '装配厂102线补废')
df['产线'] = df['产线'].replace(930000042.0, '装配厂85线补废')
df['产线'] = df['产线'].replace(930000043.0, '装配厂VM线补废')
df['产线'] = df['产线'].replace(930000044.0, '调试厂产线补废')
df['产线'] = df['产线'].replace(930000045.0, '二号工厂装配线补废')
df['产线'] = df['产线'].replace(930000046.0, '二号工厂试车线补废')
df['产线'] = df['产线'].replace(930000047.0, '二号工厂成套线补废')
df['产线'] = df['产线'].replace(930000048.0, '随机附件补充领用')
df['产线'] = df['产线'].replace(np.nan, '未定义')
df['保管员'] = df['保管员'].replace(np.nan,'未定义')
df['订单类型'] = df['订单类型'].replace('MO','一次下架')
########################################################
df['订单类型'] = df['订单类型'].replace('SO','紧急要料')
########################################################
# df_inner = df.groupby('实际缺件数')['物料'].count()
# 对city字段进行汇总,并分别计算prince的合计和均值
# df_inner.groupby('city')['price'].agg([len,np.sum, np.mean])
# df[df['creativeID']<=10000]
###########################################################
# print(df.head())
# df.to_excel('F:\excel_to_python.xlsx', sheet_name='gg')
##############导出操作###################################
'''
以上已经完成保管员的数据表
下一步需要处理
1.获取物料、产线、订单类型维护汇总的缺件总数(完成)
2.合并表的内容(完成)
3.获取指定日期的缺件数()
'''
# df_inner1.to_excel('F:\kk.xlsx', sheet_name='gg')
# df['产线'] = df['产线'].replace('485装配线','485装配线')
# df['产线'] = df['产线'].replace('随机附件','随机附件')
# df['产线'] = df['产线'].replace('4102装配线','4102装配线')
# df['产线'] = df['产线'].replace('VM装配线','VM装配线')
# df['产线'] = df['产线'].replace('整理线','整理线')
# df['产线'] = df['产线'].replace('二号厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号厂成套线','二号厂成套线')
# df['产线'] = df['产线'].replace('二号厂随机附件','二号厂随机附件')
# df['产线'] = df['产线'].replace('外协件销售出库','外协件销售出库')
# df['产线'] = df['产线'].replace('制造工程部','制造工程部')
# df['产线'] = df['产线'].replace('铸造厂','铸造厂')
# df['产线'] = df['产线'].replace('金加工厂','金加工厂')
# df['产线'] = df['产线'].replace('金加工厂机体线','金加工厂')
# df['产线'] = df['产线'].replace('装配厂','4102装配线')
# df['产线'] = df['产线'].replace('装配厂102线','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线','整理线')
# df['产线'] = df['产线'].replace('调试厂生产','整理线')
# df['产线'] = df['产线'].replace('调试厂设修','整理线')
# df['产线'] = df['产线'].replace('质量部设修','质量部')
# df['产线'] = df['产线'].replace('质量部市场','质量部')
# df['产线'] = df['产线'].replace('质量部检验','质量部')
# df['产线'] = df['产线'].replace('技术中心','技术中心')
# df['产线'] = df['产线'].replace('应用工程部','技术中心')
# df['产线'] = df['产线'].replace('产品试验中心','技术中心')
# df['产线'] = df['产线'].replace('平台开发','技术中心')
# df['产线'] = df['产线'].replace('物流部','物流部')
# df['产线'] = df['产线'].replace('二号工厂机体加工线','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线','二号工厂成套线')
# df['产线'] = df['产线'].replace('二号工厂机体加工线设修','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线设修','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线设修','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线设修','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂试车线生产工具','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线设修','二号工厂成套线')
# df['产线'] = df['产线'].replace('调试厂校机维修','校机维修')
# df['产线'] = df['产线'].replace('配件加工生产','配件加工')
# df['产线'] = df['产线'].replace('材料、零部件让售','材料、零部件让售')
# df['产线'] = df['产线'].replace('装配厂102线改型','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线改型','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线改型','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线改型','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线改型','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线改型','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线改型','二号工厂成套线')
# df['产线'] = df['产线'].replace('装配厂102线补废','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线补废','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线补废','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线补废','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线补废','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线补废','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线补废','二号工厂成套线')
# df['产线'] = df['产线'].replace('随机附件补充领用','随机附件')
df_inner1 = df.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner1.rename(columns={'sum':'缺件总数','订单类型':'业务类型'}, inplace=True)
# 物料 产线 订单类型 缺件总数 ----物料说明 ----保管员
# 01119248 随机附件 一次下架 190
# 1000045386 二号厂装配线 一次下架 1
# 1000047928 485装配线 一次下架 8
# 1000050574 调试厂产线改型 紧急要料 6
# 1000069366 485装配线 一次下架 68
# 1.获取物料、产线、订单类型维护汇总的缺件总数完成
# df_inner1.to_excel('F:\k1k.xlsx', sheet_name='gg',index=False)
#############################################################################
print('数据表逻辑处理已完成!')
Date_1 = datetime.datetime.strptime(Date, '%Y-%m-%d')
df4 = df[df['需求日期']==Date_1]
df_inner2 = df4.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner2.rename(columns={'sum':'当日缺件数','订单类型':'业务类型'}, inplace=True)
# print(df_inner2.head())
result = pd.merge(df_inner1, df_inner2, how='left', on=['物料'])
result = result.drop(columns = ['产线_y','业务类型_y','物料说明_y','保管员_y'])
result.rename(columns={'产线_x':'产线','业务类型_x':'业务类型','物料说明_x':'物料说明','保管员_x':'保管员'}, inplace=True)
result = result.groupby(['物料','物料说明','保管员','当日缺件数'])['缺件总数'].agg([np.sum]).reset_index()
result.rename(columns={'sum':'缺件总数'}, inplace=True)
# result = result.sort(columns='保管员', ascending=False)
print(result.head())
print('所有任务均已完成!')
'''
1.增加导出表的日期功能(完成)
2.在缺件表上显示日期
3.按保管员自动打印
[加分项]:按产线维度汇总
[超级加分项]:检测存在缺件时才汇总(涉及到递归算法,难度大,要重写算法)
'''
result.to_excel('F:\缺件统计表{!s}.xlsx'.format(Date), sheet_name='缺件总表',index=False)
return 'The Job is Finished'
if __name__ == '__main__':
html_to_excel()
time.sleep(5)
change_excel()
emmm
import numpy as np
import pandas as pd
import time
from pandas import merge
import datetime
import tkinter as tk
from tkinter import filedialog
Date = input('请输入日期:')
def html_to_excel():
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename()
print('已经选择的文件路径是:'+file_path)
with open(file_path,'rb') as f:
df_o = pd.read_html(f.read())
# print(df_o)
print('数据表正在合并!')
bb = pd.ExcelWriter('F:\缺件表.xlsx')
df_o[1].to_excel(bb) #一个超级大坑,随缘排错法,之前是df_o[0]>>>df_o[1]
bb.close()
'''
1.删除掉订单类型是SO的产线且是13开头的数据,再定义SO为紧急要料
2.按物料、产线对实际缺件数求和,并输出所有行>>>df_inner1
'''
# df=pd.DataFrame(pd.read_excel('YC_扬柴主机缺.xlsx'))
# print(df)
# Url = 'C:\Users\g\Desktop\CUX:缺件统计表_140618.xlsx'
# Url = input('请输入文件名:')
def change_excel():
# df = pd.read_excel(r'C:\Users\g\Desktop\CUX:缺件统计表_150618.xlsx',sheet_name=0,header=7)
df = pd.read_excel('F:\缺件表.xlsx', sheet_name=0, header=1)
# df['需求日期'] = df['需求日期'].astype(str)
df['需求日期'] = pd.to_datetime(df['需求日期'], format='%Y-%m-%d %H:%M:%S',errors='coerce')
# print(df.head())
# print(df.info())
# df['产线'] = df['产线'].astype('object')
df1 = df[(~df['产线'].isin([130000007.0,130000001.0,130000002.0,130000003.0,130000005.0,130000021.0,130000022.0,130000023.0,130000024.0]))&(df['订单类型']=='SO')]
df2 = df[df['订单类型']!='SO']
df = df1.append(df2)
print('数据表合并已完成!')
#######################逻辑处理有问题,excel导出有问题########################
#######################以上BUG已经修复#########################################
df['产线'] = df['产线'].replace(130000001.0, '485装配线')
df['产线'] = df['产线'].replace(130000007.0, '随机附件')
df['产线'] = df['产线'].replace(130000002.0, '4102装配线')
df['产线'] = df['产线'].replace(130000003.0, 'VM装配线')
df['产线'] = df['产线'].replace(130000005.0, '整理线')
df['产线'] = df['产线'].replace(130000021.0, '二号厂装配线')
df['产线'] = df['产线'].replace(130000022.0, '二号厂试车线')
df['产线'] = df['产线'].replace(130000023.0, '二号厂成套线')
df['产线'] = df['产线'].replace(130000024.0, '二号厂随机附件')
df['产线'] = df['产线'].replace(130000600.0, '外协件销售出库')
df['产线'] = df['产线'].replace(930000001.0, '制造工程部')
df['产线'] = df['产线'].replace(930000002.0, '铸造厂')
df['产线'] = df['产线'].replace(930000003.0, '金加工厂')
df['产线'] = df['产线'].replace(930000004.0, '金加工厂机体线')
df['产线'] = df['产线'].replace(930000005.0, '装配厂')
df['产线'] = df['产线'].replace(930000006.0, '装配厂102线')
df['产线'] = df['产线'].replace(930000007.0, '装配厂85线')
df['产线'] = df['产线'].replace(930000008.0, '装配厂VM线')
df['产线'] = df['产线'].replace(930000009.0, '调试厂产线')
df['产线'] = df['产线'].replace(930000010.0, '调试厂生产')
df['产线'] = df['产线'].replace(930000011.0, '调试厂设修')
df['产线'] = df['产线'].replace(930000012.0, '质量部设修')
df['产线'] = df['产线'].replace(930000013.0, '质量部市场')
df['产线'] = df['产线'].replace(930000014.0, '质量部检验')
df['产线'] = df['产线'].replace(930000015.0, '技术中心')
df['产线'] = df['产线'].replace(930000016.0, '应用工程部')
df['产线'] = df['产线'].replace(930000017.0, '产品试验中心')
df['产线'] = df['产线'].replace(930000018.0, '平台开发')
df['产线'] = df['产线'].replace(930000019.0, '物流部')
df['产线'] = df['产线'].replace(930000020.0, '二号工厂机体加工线')
df['产线'] = df['产线'].replace(930000021.0, '二号工厂缸盖加工线')
df['产线'] = df['产线'].replace(930000022.0, '二号工厂装配线')
df['产线'] = df['产线'].replace(930000023.0, '二号工厂试车线')
df['产线'] = df['产线'].replace(930000024.0, '二号工厂成套线')
df['产线'] = df['产线'].replace(930000025.0, '二号工厂机体加工线设修')
df['产线'] = df['产线'].replace(930000026.0, '二号工厂缸盖加工线设修')
df['产线'] = df['产线'].replace(930000027.0, '二号工厂装配线设修')
df['产线'] = df['产线'].replace(930000028.0, '二号工厂试车线设修')
df['产线'] = df['产线'].replace(930000029.0, '二号工厂试车线生产工具')
df['产线'] = df['产线'].replace(930000030.0, '二号工厂成套线设修')
df['产线'] = df['产线'].replace(930000031.0, '调试厂校机维修')
df['产线'] = df['产线'].replace(930000032.0, '配件加工生产')
df['产线'] = df['产线'].replace(930000033.0, '材料、零部件让售')
df['产线'] = df['产线'].replace(930000034.0, '装配厂102线改型')
df['产线'] = df['产线'].replace(930000035.0, '装配厂85线改型')
df['产线'] = df['产线'].replace(930000036.0, '装配厂VM线改型')
df['产线'] = df['产线'].replace(930000037.0, '调试厂产线改型')
df['产线'] = df['产线'].replace(930000038.0, '二号工厂装配线改型')
df['产线'] = df['产线'].replace(930000039.0, '二号工厂试车线改型')
df['产线'] = df['产线'].replace(930000040.0, '二号工厂成套线改型')
df['产线'] = df['产线'].replace(930000041.0, '装配厂102线补废')
df['产线'] = df['产线'].replace(930000042.0, '装配厂85线补废')
df['产线'] = df['产线'].replace(930000043.0, '装配厂VM线补废')
df['产线'] = df['产线'].replace(930000044.0, '调试厂产线补废')
df['产线'] = df['产线'].replace(930000045.0, '二号工厂装配线补废')
df['产线'] = df['产线'].replace(930000046.0, '二号工厂试车线补废')
df['产线'] = df['产线'].replace(930000047.0, '二号工厂成套线补废')
df['产线'] = df['产线'].replace(930000048.0, '随机附件补充领用')
# df = df.sort_values(["保管员"], ascending=True)
df['产线'] = df['产线'].replace(np.nan, '未定义')
df['保管员'] = df['保管员'].replace(np.nan,'未定义')
df['订单类型'] = df['订单类型'].replace('MO','一次下架')
########################################################
df['订单类型'] = df['订单类型'].replace('SO','紧急要料')
########################################################
# df_inner = df.groupby('实际缺件数')['物料'].count()
# 对city字段进行汇总,并分别计算prince的合计和均值
# df_inner.groupby('city')['price'].agg([len,np.sum, np.mean])
# df[df['creativeID']<=10000]
###########################################################
# print(df.head())
# df.to_excel('F:\excel_to_python.xlsx', sheet_name='gg')
##############导出操作###################################
'''
以上已经完成保管员的数据表
下一步需要处理
1.获取物料、产线、订单类型维护汇总的缺件总数(完成)
2.合并表的内容(完成)
3.获取指定日期的缺件数()
'''
# df_inner1.to_excel('F:\kk.xlsx', sheet_name='gg')
# df['产线'] = df['产线'].replace('485装配线','485装配线')
# df['产线'] = df['产线'].replace('随机附件','随机附件')
# df['产线'] = df['产线'].replace('4102装配线','4102装配线')
# df['产线'] = df['产线'].replace('VM装配线','VM装配线')
# df['产线'] = df['产线'].replace('整理线','整理线')
# df['产线'] = df['产线'].replace('二号厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号厂成套线','二号厂成套线')
# df['产线'] = df['产线'].replace('二号厂随机附件','二号厂随机附件')
# df['产线'] = df['产线'].replace('外协件销售出库','外协件销售出库')
# df['产线'] = df['产线'].replace('制造工程部','制造工程部')
# df['产线'] = df['产线'].replace('铸造厂','铸造厂')
# df['产线'] = df['产线'].replace('金加工厂','金加工厂')
# df['产线'] = df['产线'].replace('金加工厂机体线','金加工厂')
# df['产线'] = df['产线'].replace('装配厂','4102装配线')
# df['产线'] = df['产线'].replace('装配厂102线','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线','整理线')
# df['产线'] = df['产线'].replace('调试厂生产','整理线')
# df['产线'] = df['产线'].replace('调试厂设修','整理线')
# df['产线'] = df['产线'].replace('质量部设修','质量部')
# df['产线'] = df['产线'].replace('质量部市场','质量部')
# df['产线'] = df['产线'].replace('质量部检验','质量部')
# df['产线'] = df['产线'].replace('技术中心','技术中心')
# df['产线'] = df['产线'].replace('应用工程部','技术中心')
# df['产线'] = df['产线'].replace('产品试验中心','技术中心')
# df['产线'] = df['产线'].replace('平台开发','技术中心')
# df['产线'] = df['产线'].replace('物流部','物流部')
# df['产线'] = df['产线'].replace('二号工厂机体加工线','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线','二号工厂成套线')
# df['产线'] = df['产线'].replace('二号工厂机体加工线设修','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线设修','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线设修','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线设修','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂试车线生产工具','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线设修','二号工厂成套线')
# df['产线'] = df['产线'].replace('调试厂校机维修','校机维修')
# df['产线'] = df['产线'].replace('配件加工生产','配件加工')
# df['产线'] = df['产线'].replace('材料、零部件让售','材料、零部件让售')
# df['产线'] = df['产线'].replace('装配厂102线改型','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线改型','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线改型','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线改型','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线改型','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线改型','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线改型','二号工厂成套线')
# df['产线'] = df['产线'].replace('装配厂102线补废','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线补废','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线补废','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线补废','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线补废','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线补废','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线补废','二号工厂成套线')
# df['产线'] = df['产线'].replace('随机附件补充领用','随机附件')
df_inner1 = df.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner1.rename(columns={'sum':'缺件总数','订单类型':'业务类型'}, inplace=True)
# 物料 产线 订单类型 缺件总数 ----物料说明 ----保管员
# 01119248 随机附件 一次下架 190
# 1000045386 二号厂装配线 一次下架 1
# 1000047928 485装配线 一次下架 8
# 1000050574 调试厂产线改型 紧急要料 6
# 1000069366 485装配线 一次下架 68
# 1.获取物料、产线、订单类型维护汇总的缺件总数完成
# df_inner1.to_excel('F:\k1k.xlsx', sheet_name='gg',index=False)
#############################################################################
print('数据表逻辑处理已完成!')
Date_1 = datetime.datetime.strptime(Date, '%Y-%m-%d')
df4 = df[df['需求日期']==Date_1]
# df4.sort_values(['保管员'],ascending=True)
df_inner2 = df4.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner2.rename(columns={'sum':'当日缺件数','订单类型':'业务类型'}, inplace=True)
# print(df_inner2.head())
result = pd.merge(df_inner1, df_inner2, how='left', on=['物料'])
result = result.drop(columns = ['产线_y','业务类型_y','物料说明_y','保管员_y'])
result.rename(columns={'产线_x':'产线','业务类型_x':'业务类型','物料说明_x':'物料说明','保管员_x':'保管员'}, inplace=True)
result = result.groupby(['物料','物料说明','保管员','当日缺件数'])['缺件总数'].agg([np.sum]).reset_index()
result.rename(columns={'sum':'缺件总数'}, inplace=True)
# result.sort_values(result['保管员'].astype(str), ascending=False)
# result.sort_values(['保管员'],ascending=True)
# result.sort_values(["保管员"], ascending=True)
result['保管员'] = result['保管员'].replace('未定义', 99.0)
result = result.sort_values(["保管员"], ascending=True)
result['保管员'] = result['保管员'].replace(99.0,'未定义')
print(result.head())
print('所有任务均已完成!')
'''
1.增加导出表的日期功能(完成)
2.在缺件表上显示日期
3.按保管员自动打印
[加分项]:按产线维度汇总
[超级加分项]:检测存在缺件时才汇总(涉及到递归算法,难度大,要重写算法)
''' result.to_excel('F:\缺件统计表{!s}.xlsx'.format(Date), sheet_name='缺件总表',index=False)
return 'The Job is Finished' def del_file(file_path):
import os
filename = file_path
if os.path.exists(filename):
os.remove(filename)
print(filename+'已经成功删除')
else:
print(filename+'文件不存在')
'''
对excel表的具体操作
0.在表头加日期
1.所有单元格居中
2.所有单元格加框线
3.设置打印格式
######################################################
对用户界面的具体操作
0.制作应用界面窗口
1.设置其他报错信息
2.完成封装exe格式
''' if __name__ == '__main__':
html_to_excel()
time.sleep(5)
change_excel()
del_file('F:\缺件表.xlsx')
emmm更新
关于pands库不能直接封装成exe的原因:https://stackoverflow.com/questions/33001327/importerror-with-pyinstaller-and-pandas
The reason this is necessary is PyInstaller is grabbing pandas python code, but not grabbing the lib. This means that when the pandas code runs (from 'inside' the executable) it can't find the lib – so it tries to be helpful and suggest you need to build it.
总的来说就是你要指引PyInstaller去抓取lib下的第三方库pandas
import numpy as np
import pandas as pd
import time
import datetime
import tkinter as tk
from tkinter import filedialog
window = tk.Tk()
window.title("缺件分析自动处理")
window.geometry('400x200')
Label1 = tk.Label(window, text='需求日期:').grid(row=0, column=0)
Label2 = tk.Label(window, text='选择文件:').grid(row=2, column=0)
v1 = tk.StringVar()
file_path = ''
Date = tk.Entry(window, textvariable=v1) # Entry 是 Tkinter 用来接收字符串等输入的控件.
Date.grid(row=0, column=1, padx=10, pady=5) # 设置输入框显示的位置,以及长和宽属性
def showdate():
print("需求日期:%s" % Date.get()) # 获取用户输入的信息
def showprofile():
global file_path
file_path = filedialog.askopenfilename()
tk.Button(window, text='浏览', width=10, command=showprofile) \
.grid(row=2, column=1, padx=10, pady=5)
tk.Button(window, text='确定', width=10, command=window.quit)\
.grid(row=4, column=0, padx=10, pady=5)
tk.Button(window, text='退出', width=10, command=window.quit) \
.grid(row=4, column=1,padx=10, pady=5)
tk.mainloop()
def html_to_excel():
print('已经选择的文件路径是:'+file_path)
with open(file_path,'rb') as f:
df_o = pd.read_html(f.read())
# print(df_o)
print('数据表正在合并!')
bb = pd.ExcelWriter('F:\缺件表.xlsx')
df_o[1].to_excel(bb) #一个超级大坑,随缘排错法,之前是df_o[0]>>>df_o[1]
bb.close()
'''
1.删除掉订单类型是SO的产线且是13开头的数据,再定义SO为紧急要料
2.按物料、产线对实际缺件数求和,并输出所有行>>>df_inner1
'''
# df=pd.DataFrame(pd.read_excel('YC_扬柴主机缺.xlsx'))
# print(df)
# Url = 'C:\Users\g\Desktop\CUX:缺件统计表_140618.xlsx'
# Url = input('请输入文件名:')
def change_excel():
# df = pd.read_excel(r'C:\Users\g\Desktop\CUX:缺件统计表_150618.xlsx',sheet_name=0,header=7)
df = pd.read_excel('F:\缺件表.xlsx', sheet_name=0, header=1)
# df['需求日期'] = df['需求日期'].astype(str)
df['需求日期'] = pd.to_datetime(df['需求日期'], format='%Y-%m-%d %H:%M:%S',errors='coerce')
# print(df.head())
# print(df.info())
# df['产线'] = df['产线'].astype('object')
df1 = df[(~df['产线'].isin([130000007.0,130000001.0,130000002.0,130000003.0,130000005.0,130000021.0,130000022.0,130000023.0,130000024.0]))&(df['订单类型']=='SO')]
df2 = df[df['订单类型']!='SO']
df = df1.append(df2)
print('数据表合并已完成!')
#######################逻辑处理有问题,excel导出有问题########################
#######################以上BUG已经修复#########################################
df['产线'] = df['产线'].replace(130000001.0, '485装配线')
df['产线'] = df['产线'].replace(130000007.0, '随机附件')
df['产线'] = df['产线'].replace(130000002.0, '4102装配线')
df['产线'] = df['产线'].replace(130000003.0, 'VM装配线')
df['产线'] = df['产线'].replace(130000005.0, '整理线')
df['产线'] = df['产线'].replace(130000021.0, '二号厂装配线')
df['产线'] = df['产线'].replace(130000022.0, '二号厂试车线')
df['产线'] = df['产线'].replace(130000023.0, '二号厂成套线')
df['产线'] = df['产线'].replace(130000024.0, '二号厂随机附件')
df['产线'] = df['产线'].replace(130000600.0, '外协件销售出库')
df['产线'] = df['产线'].replace(930000001.0, '制造工程部')
df['产线'] = df['产线'].replace(930000002.0, '铸造厂')
df['产线'] = df['产线'].replace(930000003.0, '金加工厂')
df['产线'] = df['产线'].replace(930000004.0, '金加工厂机体线')
df['产线'] = df['产线'].replace(930000005.0, '装配厂')
df['产线'] = df['产线'].replace(930000006.0, '装配厂102线')
df['产线'] = df['产线'].replace(930000007.0, '装配厂85线')
df['产线'] = df['产线'].replace(930000008.0, '装配厂VM线')
df['产线'] = df['产线'].replace(930000009.0, '调试厂产线')
df['产线'] = df['产线'].replace(930000010.0, '调试厂生产')
df['产线'] = df['产线'].replace(930000011.0, '调试厂设修')
df['产线'] = df['产线'].replace(930000012.0, '质量部设修')
df['产线'] = df['产线'].replace(930000013.0, '质量部市场')
df['产线'] = df['产线'].replace(930000014.0, '质量部检验')
df['产线'] = df['产线'].replace(930000015.0, '技术中心')
df['产线'] = df['产线'].replace(930000016.0, '应用工程部')
df['产线'] = df['产线'].replace(930000017.0, '产品试验中心')
df['产线'] = df['产线'].replace(930000018.0, '平台开发')
df['产线'] = df['产线'].replace(930000019.0, '物流部')
df['产线'] = df['产线'].replace(930000020.0, '二号工厂机体加工线')
df['产线'] = df['产线'].replace(930000021.0, '二号工厂缸盖加工线')
df['产线'] = df['产线'].replace(930000022.0, '二号工厂装配线')
df['产线'] = df['产线'].replace(930000023.0, '二号工厂试车线')
df['产线'] = df['产线'].replace(930000024.0, '二号工厂成套线')
df['产线'] = df['产线'].replace(930000025.0, '二号工厂机体加工线设修')
df['产线'] = df['产线'].replace(930000026.0, '二号工厂缸盖加工线设修')
df['产线'] = df['产线'].replace(930000027.0, '二号工厂装配线设修')
df['产线'] = df['产线'].replace(930000028.0, '二号工厂试车线设修')
df['产线'] = df['产线'].replace(930000029.0, '二号工厂试车线生产工具')
df['产线'] = df['产线'].replace(930000030.0, '二号工厂成套线设修')
df['产线'] = df['产线'].replace(930000031.0, '调试厂校机维修')
df['产线'] = df['产线'].replace(930000032.0, '配件加工生产')
df['产线'] = df['产线'].replace(930000033.0, '材料、零部件让售')
df['产线'] = df['产线'].replace(930000034.0, '装配厂102线改型')
df['产线'] = df['产线'].replace(930000035.0, '装配厂85线改型')
df['产线'] = df['产线'].replace(930000036.0, '装配厂VM线改型')
df['产线'] = df['产线'].replace(930000037.0, '调试厂产线改型')
df['产线'] = df['产线'].replace(930000038.0, '二号工厂装配线改型')
df['产线'] = df['产线'].replace(930000039.0, '二号工厂试车线改型')
df['产线'] = df['产线'].replace(930000040.0, '二号工厂成套线改型')
df['产线'] = df['产线'].replace(930000041.0, '装配厂102线补废')
df['产线'] = df['产线'].replace(930000042.0, '装配厂85线补废')
df['产线'] = df['产线'].replace(930000043.0, '装配厂VM线补废')
df['产线'] = df['产线'].replace(930000044.0, '调试厂产线补废')
df['产线'] = df['产线'].replace(930000045.0, '二号工厂装配线补废')
df['产线'] = df['产线'].replace(930000046.0, '二号工厂试车线补废')
df['产线'] = df['产线'].replace(930000047.0, '二号工厂成套线补废')
df['产线'] = df['产线'].replace(930000048.0, '随机附件补充领用')
# df = df.sort_values(["保管员"], ascending=True)
df['产线'] = df['产线'].replace(np.nan, '未定义')
df['保管员'] = df['保管员'].replace(np.nan,'未定义')
df['订单类型'] = df['订单类型'].replace('MO','一次下架')
########################################################
df['订单类型'] = df['订单类型'].replace('SO','紧急要料')
########################################################
# df_inner = df.groupby('实际缺件数')['物料'].count()
# 对city字段进行汇总,并分别计算prince的合计和均值
# df_inner.groupby('city')['price'].agg([len,np.sum, np.mean])
# df[df['creativeID']<=10000]
###########################################################
# print(df.head())
# df.to_excel('F:\excel_to_python.xlsx', sheet_name='gg')
##############导出操作###################################
'''
以上已经完成保管员的数据表
下一步需要处理
1.获取物料、产线、订单类型维护汇总的缺件总数(完成)
2.合并表的内容(完成)
3.获取指定日期的缺件数()
'''
# df_inner1.to_excel('F:\kk.xlsx', sheet_name='gg')
# df['产线'] = df['产线'].replace('485装配线','485装配线')
# df['产线'] = df['产线'].replace('随机附件','随机附件')
# df['产线'] = df['产线'].replace('4102装配线','4102装配线')
# df['产线'] = df['产线'].replace('VM装配线','VM装配线')
# df['产线'] = df['产线'].replace('整理线','整理线')
# df['产线'] = df['产线'].replace('二号厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号厂成套线','二号厂成套线')
# df['产线'] = df['产线'].replace('二号厂随机附件','二号厂随机附件')
# df['产线'] = df['产线'].replace('外协件销售出库','外协件销售出库')
# df['产线'] = df['产线'].replace('制造工程部','制造工程部')
# df['产线'] = df['产线'].replace('铸造厂','铸造厂')
# df['产线'] = df['产线'].replace('金加工厂','金加工厂')
# df['产线'] = df['产线'].replace('金加工厂机体线','金加工厂')
# df['产线'] = df['产线'].replace('装配厂','4102装配线')
# df['产线'] = df['产线'].replace('装配厂102线','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线','整理线')
# df['产线'] = df['产线'].replace('调试厂生产','整理线')
# df['产线'] = df['产线'].replace('调试厂设修','整理线')
# df['产线'] = df['产线'].replace('质量部设修','质量部')
# df['产线'] = df['产线'].replace('质量部市场','质量部')
# df['产线'] = df['产线'].replace('质量部检验','质量部')
# df['产线'] = df['产线'].replace('技术中心','技术中心')
# df['产线'] = df['产线'].replace('应用工程部','技术中心')
# df['产线'] = df['产线'].replace('产品试验中心','技术中心')
# df['产线'] = df['产线'].replace('平台开发','技术中心')
# df['产线'] = df['产线'].replace('物流部','物流部')
# df['产线'] = df['产线'].replace('二号工厂机体加工线','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线','二号工厂成套线')
# df['产线'] = df['产线'].replace('二号工厂机体加工线设修','二号工厂机体')
# df['产线'] = df['产线'].replace('二号工厂缸盖加工线设修','二号工厂缸盖')
# df['产线'] = df['产线'].replace('二号工厂装配线设修','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线设修','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂试车线生产工具','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线设修','二号工厂成套线')
# df['产线'] = df['产线'].replace('调试厂校机维修','校机维修')
# df['产线'] = df['产线'].replace('配件加工生产','配件加工')
# df['产线'] = df['产线'].replace('材料、零部件让售','材料、零部件让售')
# df['产线'] = df['产线'].replace('装配厂102线改型','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线改型','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线改型','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线改型','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线改型','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线改型','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线改型','二号工厂成套线')
# df['产线'] = df['产线'].replace('装配厂102线补废','4102装配线')
# df['产线'] = df['产线'].replace('装配厂85线补废','485装配线')
# df['产线'] = df['产线'].replace('装配厂VM线补废','VM装配线')
# df['产线'] = df['产线'].replace('调试厂产线补废','整理线')
# df['产线'] = df['产线'].replace('二号工厂装配线补废','二号厂装配线')
# df['产线'] = df['产线'].replace('二号工厂试车线补废','二号厂试车线')
# df['产线'] = df['产线'].replace('二号工厂成套线补废','二号工厂成套线')
# df['产线'] = df['产线'].replace('随机附件补充领用','随机附件')
df_inner1 = df.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner1.rename(columns={'sum':'缺件总数','订单类型':'业务类型'}, inplace=True)
# 物料 产线 订单类型 缺件总数 ----物料说明 ----保管员
# 01119248 随机附件 一次下架 190
# 1000045386 二号厂装配线 一次下架 1
# 1000047928 485装配线 一次下架 8
# 1000050574 调试厂产线改型 紧急要料 6
# 1000069366 485装配线 一次下架 68
# 1.获取物料、产线、订单类型维护汇总的缺件总数完成
# df_inner1.to_excel('F:\k1k.xlsx', sheet_name='gg',index=False)
#############################################################################
print('数据表逻辑处理已完成!')
Date_1 = datetime.datetime.strptime(str(Date.get()), '%Y-%m-%d')
df4 = df[df['需求日期']==Date_1]
# df4.sort_values(['保管员'],ascending=True)
df_inner2 = df4.groupby(['产线','订单类型','物料','物料说明','保管员'])['实际缺件数'].agg([np.sum]).reset_index()
df_inner2.rename(columns={'sum':'当日缺件数','订单类型':'业务类型'}, inplace=True)
# print(df_inner2.head())
result = pd.merge(df_inner1, df_inner2, how='left', on=['物料'])
result = result.drop(columns = ['产线_y','业务类型_y','物料说明_y','保管员_y'])
result.rename(columns={'产线_x':'产线','业务类型_x':'业务类型','物料说明_x':'物料说明','保管员_x':'保管员'}, inplace=True)
result = result.groupby(['物料','物料说明','保管员','当日缺件数'])['缺件总数'].agg([np.sum]).reset_index()
result.rename(columns={'sum':'缺件总数'}, inplace=True)
# result.sort_values(result['保管员'].astype(str), ascending=False)
# result.sort_values(['保管员'],ascending=True)
# result.sort_values(["保管员"], ascending=True)
result['保管员'] = result['保管员'].replace('未定义', 99.0)
result = result.sort_values(["保管员"], ascending=True)
result['保管员'] = result['保管员'].replace(99.0,'未定义')
print(result.head())
print('所有任务均已完成!')
'''
1.增加导出表的日期功能(完成)
2.在缺件表上显示日期
3.按保管员自动打印
[加分项]:按产线维度汇总
[超级加分项]:检测存在缺件时才汇总(涉及到递归算法,难度大,要重写算法)
''' result.to_excel('F:\缺件统计表{!s}.xlsx'.format(str(Date.get())), sheet_name='缺件总表',index=False)
return 'The Job is Finished' def del_file(file_path):
import os
filename = file_path
if os.path.exists(filename):
os.remove(filename)
print(filename+'已经成功删除')
else:
print(filename+'文件不存在')
'''
对excel表的具体操作
0.在表头加日期
1.所有单元格居中
2.所有单元格加框线
3.设置打印格式
######################################################
对用户界面的具体操作
0.制作应用界面窗口
1.设置其他报错信息
2.完成封装exe格式
''' if __name__ == '__main__':
html_to_excel()
time.sleep(5)
change_excel()
del_file('F:\缺件表.xlsx')
小bug(不影响使用)
pandaboy玩pandas的更多相关文章
- Pandas进阶之提升运行效率
前言 如果你现在正在学习数据分析,或者正在从事数据分析行业,肯定会处理一些大数据集.pandas就是这些大数据集的一个很好的处理工具.那么pandas到底是什么呢?官方文档上说: " 快速, ...
- 玩转pandas
一.pandas概述 pandas :pannel data analysis(面板数据分析).pandas是基于numpy构建的,为时间序列分析提供了很好的支持.pandas中有两个主要的数据结构, ...
- 五、Pandas玩转数据
Series的简单运算 import numpy as np import pandas as pd s1=pd.Series([1,2,3],index=['A','B','C']) print(s ...
- pandas玩转excel-> (1)如何利用pandas创建【行,列,单元格】
import pandas as pd #------新建单元格的方法一:通过先创建字典的形式 #可以先新建一个字典d={'x':100,'y':200,'z':300} #打印字典的索引print( ...
- pandas玩转excel-> (2)如何利用pandas读取excel数据文件
import pandas as pd #将excel文件读到内存中,形成dataframe,并命名为peoplepeople=pd.read_excel('D:/python结果/task2/Peo ...
- pandas玩转excel-> (1)如何利用pandas创建excel数据文件
#在Anaconda3 的Spyder中 #定义pandas模块为pd import pandas as pd #创建一个新的DataFrame对象,定义这个对象中有两个字段:ID和Name, ...
- Python数据分析:pandas玩转Excel (二)
1 对Excel文件的操作 方法一: 使用xlrd库或者xlwt库进行对excel表格的操作读与写: 方法二: pandas库同样支持excel的读写操作:且更加简便. 2 pd.read_excel ...
- Python数据分析:pandas玩转Excel (一)
目录 1 pandas简介 2 导入 3 使用 4 读取.写入 1 pandas简介 1.Pandas是什么? Pandas是一个强大的分析结构化数据的工具集: 它的使用基础是Numpy(提供高性能的 ...
- 用实战玩转pandas数据分析(一)——用户消费行为分析(python)
CD商品订单数据的分析总结.根据订单数据(用户的消费记录),从时间维度和用户维度,分析该网站用户的消费行为.通过此案例,总结订单数据的一些共性,能通过用户的消费记录挖掘出对业务有用的信息.对其他产 ...
随机推荐
- JAVA实现两种方法反转单列表
/** * @author luochengcheng * 定义一个单链表 */ class Node { //变量 private int record; //指向下一个对象 private Nod ...
- css样式表格边框1px hover时为2px 实现方式
//css .flclass-cont .flclass-cont-box{width:%;display:inline-block;font-size:;margin:10px;position:r ...
- Eclipse中切换GIT分支
切换GIT分支: 右击项目——Team——Switch To——选择你要切换的分支.
- HDU 1576 A/B( 逆元水 )
链接:传送门 思路: 现在给出 n = A % 9973,n = A - A/9973×9973,已知 B|A ,设 A = Bx,可以得到如下形式的式子:Bx + 9973×y = n ,因为gcd ...
- 紫书 习题7-13 UVa 817(dfs+栈求表达式的值)
题目链接 点击打开链接 这道题分为两个部分, 一用搜索枚举每种可能, 二计算表达式的值, 有挺多细节需要注意 特别注意我的代码中在计算表达式的值中用到了一个!(代码枚举中的!表示不加符号, 我现在说 ...
- [luogu] P4823 [TJOI2013]拯救小矮人(贪心)
P4823 [TJOI2013]拯救小矮人 题目描述 一群小矮人掉进了一个很深的陷阱里,由于太矮爬不上来,于是他们决定搭一个人梯.即:一个小矮人站在另一小矮人的 肩膀上,知道最顶端的小矮人伸直胳膊可以 ...
- tp框架,addAll方法报错,返回false
tp框架的批量添加addAll($data)方法很实用,但是注意,数据数组的数据结构要保持一致,不然会返回false.
- excel2013超链接进不去,提示“您的组织策略不允许...”
搜索regedit 然后找到HKEY_CURRENT_USER->Software->Classes->.html 右键修改或者双击修改数值数据为Htmlfile 关闭之后此窗口,关 ...
- Docker可视化管理工具对比(DockerUI、Shipyard、Rancher、Portainer)
1.前言 谈及docker,避免不了需要熟练的记住好多命令及其用法,对于熟悉shell.技术开发人员而言,还是可以接受的,熟练之后,命令行毕竟是很方便的,便于操作及脚本化.但对于命令行过敏.非技术人员 ...
- jquery-jquery异步提交表单插件
使用jquery.form可以异步提交文件或者表单,下面的代码演示了如何提交文件 http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js <s ...