2018年7月26日
摘要: 列表(list) a=[] 安装先后顺序,有下表位[index],可以重复,可变类型元组(tuple) a=() 有先后顺序,有下标位,元素可以重复,不可变(只能查)字典(dict) a={} 没有先后顺序,没有下标,key不可重复... 阅读全文
posted @ 2018-07-26 10:46 CircleYuan 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 对重复值的处理把数据结构中,行相同的数据只保留一行函数语法: drop_duplicates()from pandas import read_csvdf = read_csv(文件位置)newdf = df.drop_duplicates(); 对缺失值的处理... 阅读全文
posted @ 2018-07-26 10:43 CircleYuan 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 使用read_csv函数导入CSV文件read.csv函数语法 read_csv(file,encoding)例子: Age,Name 22,wangwei 23,lixin 24,liqing -... 阅读全文
posted @ 2018-07-26 10:31 CircleYuan 阅读(678) 评论(0) 推荐(0) 编辑
摘要: Python2随机写入二进制文件:with open('/python2/random.bin','w') as f: f.write(os.urandom(10))但使用Python3会报错:TypeError:must be str, not bytes原因... 阅读全文
posted @ 2018-07-26 10:24 CircleYuan 阅读(530) 评论(0) 推荐(0) 编辑