摘要: 1. 计算月初。2022-05-03 得到2022-05-01 df['month']=df['purchase_date'].apply(lambda x : x.replace(day=1)) 阅读全文
posted @ 2023-02-07 16:10 ttttttian 阅读(25) 评论(0) 推荐(0)
摘要: ### 众数 [众数:](https://geek-docs.com/sql/sql-examples/sql-calculation-mode.html) * 情况①:一组数据中,出现次数最多的数就叫这组数据的众数。 举例:1,2,3,3,4的众数是3。 * 情况② :如果有两个或两个以上个数出现 阅读全文
posted @ 2023-02-05 11:22 ttttttian 阅读(1252) 评论(0) 推荐(0)
摘要: 法一: pd.DataFrame( [ (第一行),(第二行),(第三行)] ) df = pd.DataFrame([('bird', 389.0), ('bird', 24.0), ('mammal', 80.5), ('mammal', np.nan)], index=['falcon', ' 阅读全文
posted @ 2023-02-04 20:39 ttttttian 阅读(299) 评论(0) 推荐(0)