基于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的更多相关文章

  1. Pandas进阶之提升运行效率

    前言 如果你现在正在学习数据分析,或者正在从事数据分析行业,肯定会处理一些大数据集.pandas就是这些大数据集的一个很好的处理工具.那么pandas到底是什么呢?官方文档上说: " 快速, ...

  2. 玩转pandas

    一.pandas概述 pandas :pannel data analysis(面板数据分析).pandas是基于numpy构建的,为时间序列分析提供了很好的支持.pandas中有两个主要的数据结构, ...

  3. 五、Pandas玩转数据

    Series的简单运算 import numpy as np import pandas as pd s1=pd.Series([1,2,3],index=['A','B','C']) print(s ...

  4. pandas玩转excel-> (1)如何利用pandas创建【行,列,单元格】

    import pandas as pd #------新建单元格的方法一:通过先创建字典的形式 #可以先新建一个字典d={'x':100,'y':200,'z':300} #打印字典的索引print( ...

  5. pandas玩转excel-> (2)如何利用pandas读取excel数据文件

    import pandas as pd #将excel文件读到内存中,形成dataframe,并命名为peoplepeople=pd.read_excel('D:/python结果/task2/Peo ...

  6. pandas玩转excel-> (1)如何利用pandas创建excel数据文件

    #在Anaconda3 的Spyder中   #定义pandas模块为pd import pandas as pd   #创建一个新的DataFrame对象,定义这个对象中有两个字段:ID和Name, ...

  7. Python数据分析:pandas玩转Excel (二)

    1 对Excel文件的操作 方法一: 使用xlrd库或者xlwt库进行对excel表格的操作读与写: 方法二: pandas库同样支持excel的读写操作:且更加简便. 2 pd.read_excel ...

  8. Python数据分析:pandas玩转Excel (一)

    目录 1 pandas简介 2 导入 3 使用 4 读取.写入 1 pandas简介 1.Pandas是什么? Pandas是一个强大的分析结构化数据的工具集: 它的使用基础是Numpy(提供高性能的 ...

  9. 用实战玩转pandas数据分析(一)——用户消费行为分析(python)

      CD商品订单数据的分析总结.根据订单数据(用户的消费记录),从时间维度和用户维度,分析该网站用户的消费行为.通过此案例,总结订单数据的一些共性,能通过用户的消费记录挖掘出对业务有用的信息.对其他产 ...

随机推荐

  1. JS 限制input框的输入字数,并提示可输入字数

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  2. 浅谈AVL树,红黑树,B树,B+树原理及应用

    背景:这几天在看<高性能Mysql>,在看到创建高性能的索引,书上说mysql的存储引擎InnoDB采用的索引类型是B+Tree,那么,大家有没有产生这样一个疑问,对于数据索引,为什么要使 ...

  3. 谈 instanceof 和 typeof 的实现原理

    typeof: js 在底层存储变量的时候,会在变量的机器码的低位1-3位存储其类型信息

  4. [学习笔记] CS131 Computer Vision: Foundations and Applications:Lecture 3 线性代数初步

    向量和矩阵 什么是矩阵/向量? Vectors and matrix are just collections of ordered numbers that represent something: ...

  5. MongoDB入门 常用命令以及增删改查的简单操作

    1,运行MongoDB服务mongod --dbpath=/usr/local/developmentTool/mongo/data/db/然后启动客户端mongo2,sudo service mon ...

  6. UGUI图集管理

    using UnityEngine; using System.Collections; using System.Collections.Generic; //纹理图集加载管理 public cla ...

  7. NOIP2018提高组省一冲奖班模测训练(三)

    NOIP2018提高组省一冲奖班模测训练(三) 自己按照noip的方式考,只在最后一两分钟交了一次 第一题过了,对拍拍到尾. 第二题不会.考试时往组合计数的方向想,推公式,推了一个多小时,大脑爆炸,还 ...

  8. open函数详解

    转载:https://www.cnblogs.com/frank-yxs/p/5925574.html open函数用来在进程中打开文件,如果成功则返回一个文件描述符fd. ============= ...

  9. NYIST 677 碟战

    碟战时间限制:2000 ms | 内存限制:65535 KB难度:4 描述知己知彼,百战不殆!在战争中如果被敌人掌握了自己的机密,失败是必然的.K国在一场战争中屡屡失败,就想到自己的某些城市可能会有敌 ...

  10. 洛谷——P2822 组合数问题

    https://www.luogu.org/problem/show?pid=2822 题目描述 组合数C_n^mC​n​m​​表示的是从n个物品中选出m个物品的方案数.举个例子,从(1,2,3) 三 ...