上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页
摘要: python对齐输出 https://www.cnblogs.com/nul1/p/11136495.html python - 输出列表自动对齐(支持中英文混合) https://blog.csdn.net/weixin_44823747/article/details/108118181?utm 阅读全文
posted @ 2020-10-14 09:30 cup_leo 阅读(2127) 评论(0) 推荐(0) 编辑
摘要: import time from datetime import datetime def getBetweenDay(begin_date,end_date): date_list = [] begin_date = datetime.strptime(begin_date, "%Y-%m-%d" 阅读全文
posted @ 2020-07-09 09:37 cup_leo 阅读(1085) 评论(0) 推荐(0) 编辑
摘要: create table incre_table (AutoIncreID int); insert into incre_table values (1); insert into incre_table values (2); insert into incre_table values (3) 阅读全文
posted @ 2020-06-15 06:57 cup_leo 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 发现一个免费资源很适合技术的PPT网站: http://www.ypppt.com/ 分享给大家哦 阅读全文
posted @ 2020-05-24 10:09 cup_leo 阅读(191) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # coding: utf-8 import datetime def last_day_of_month(any_day): """ 获取获得一个月中的最后一天 :param any_day: 任意日期 :return: string """ next 阅读全文
posted @ 2020-05-05 21:08 cup_leo 阅读(1753) 评论(0) 推荐(1) 编辑
摘要: LabelEncoder可以将标签分配一个0—n_classes-1之间的编码 将各种标签分配一个可数的连续编号 将DataFrame中的每一行ID标签分别转换成连续编号: import pandas as pd from sklearn.preprocessing import LabelEnco 阅读全文
posted @ 2020-04-30 20:53 cup_leo 阅读(1210) 评论(0) 推荐(0) 编辑
摘要: 一般用python查询MySQL后,返回的结果是list或者tuple,如何取某一列数据呢? mysql的返回值可以是tuple也可以是dict,常用的时tuple。 有时候想要根据前一个SQL的结果去生成另一个SQL,比如: sql1 = select id,name from article l 阅读全文
posted @ 2020-02-18 10:30 cup_leo 阅读(1896) 评论(0) 推荐(0) 编辑
摘要: param = [1,2,3] #或者 param = [‘1’,‘2’,‘3’] sql_in = """ SELECT id,customer_number,customer_name from customer_info where id in {} """.format(tuple(para 阅读全文
posted @ 2020-02-18 10:24 cup_leo 阅读(1193) 评论(0) 推荐(0) 编辑
摘要: res.groupby(['customer_id'])['project_name'].apply(lambda x:', '.join(x)).reset_index() x.groupby(['sa'])['daList'].apply(lambda x:np.concatenate(list 阅读全文
posted @ 2020-02-06 18:22 cup_leo 阅读(1158) 评论(0) 推荐(0) 编辑
摘要: #多个单元格合并成一列 def ab(df): return', '.join(df.values) #剔除空字符或者空值 data = data[(data['project'].isnull()==False) & (data['project']!='')] data1 = data.grou 阅读全文
posted @ 2019-12-25 08:45 cup_leo 阅读(3946) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页