示例页面
摘要: Pandas主要数据结构包括Series(一维数据,同构)和DataFrame(二维数据,异构)。Pandas是基于Numpy开发。 Series ###基本操作 import pandas as pd import numpy as np #%% 创建一维数据 s = pd.Series([1, 阅读全文
posted @ 2021-02-19 16:40 没有风格的Wang 阅读(324) 评论(0) 推荐(0) 编辑
摘要: open方法 file = open(filename [,mode,encoding]) file.close() |mode|可做操作|是否覆盖|若文件不存在| | : | : |: |: | |r|只能读,以只读模式打开文件,文件指针在开头|-|报错| |r+|可读可写|是|报错| |w|只能 阅读全文
posted @ 2021-02-19 15:27 没有风格的Wang 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 日期和时间 Python 程序能用很多方式处理日期和时间,转换日期格式是一个常见的功能。 Python 提供了一个 time 和 calendar 模块可以用于格式化日期和时间。 时间间隔是以秒为单位的浮点小数。 每个时间戳都以自从1970年1月1日午夜(历元)经过了多长时间来表示。 Python 阅读全文
posted @ 2021-02-19 15:26 没有风格的Wang 阅读(110) 评论(0) 推荐(0) 编辑
摘要: xlrd 读取数据 xlwt 写入数据,要求列数不能超过256 xlsxwriter 写入数据,支持列数超过256列,但不支持带格式文件 openpyxl 性能不稳定 读 # 导入库 import xlrd # 调用库中的函数,读取工作薄 xlsx = xlrd.open_workbook('exc 阅读全文
posted @ 2021-02-19 14:55 没有风格的Wang 阅读(357) 评论(0) 推荐(0) 编辑
摘要: """ 绩效月:上个月20号-本月19号 给定一个日期,输入其所在的绩效月 """ def performance_month(date): # 提取年 year = date[0:4] # 提取月 month = date[5:7] # 提取日 day = date[8:10] # 判断和拼接 # 阅读全文
posted @ 2021-02-19 11:50 没有风格的Wang 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import os import xlwt # 要查找的目录 file_dir='d:/' # 目录下面的所有文件名 os.listdir(file_dir) # print(os.listdir(file_dir)) new_workbook = xlwt.Workbook() worksheet 阅读全文
posted @ 2021-02-19 11:49 没有风格的Wang 阅读(968) 评论(0) 推荐(0) 编辑