![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据处理
onlyyou624
这个作者很懒,什么都没留下…
展开
-
python 生成随机邮箱
def generate_random_email(): #用数字0-9 和字母a-z 生成随机邮箱。 list_sum = [i for i in range(10)] + ["a", "b", "c", "d", "e", "f", "g", "h", 'i', "j", "k", "l", "M", "n", "o", "p", "q", "r", "s", "t", "u", "v", .原创 2020-07-17 10:47:31 · 4395 阅读 · 0 评论 -
python & pandas 比较两个文件并把不同写入第三个文件
import pandas as pd# 读取第一个文件内容df_low = pd.read_csv("id_check_total_india_1594870405.csv")# 读取第二个文件内容df_more = pd.read_csv("Aadhaar卡简版测试样本.csv")low_order_id = df_low["order_no"]more_id = df_more["order_no"]# 用set 集合找到不同的order idlow_set = set(low_.原创 2020-07-17 10:15:47 · 1718 阅读 · 0 评论 -
追加写入dataframe
def write_df_to_csv(df, index): if index == 0: df.loc[[index]].to_csv(output_file_name, mode='w', index=False) else: df.loc[[index]].to_csv( output_file_name, mode='a', header=False, index=False )原创 2020-05-21 15:19:35 · 1536 阅读 · 0 评论 -
python 针对列表求交集的操作
已知:list1 = [1, 2, 3, 4, 5] list2 = [1, 4, 5]要求两个列表中不相同的元素方法一:list3 = list(set(list1) – set(list2)) set操作会将一个list转换成一个集合。 假设:list_t = [1, 2, ...原创 2020-04-26 16:40:57 · 1502 阅读 · 0 评论