vault backup: 2024-03-16 18:44:23
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
aliases:
|
||||
atlas: "[[Atlas/Card|Card]]"
|
||||
created: 2024-03-15 21:36:51
|
||||
modified: 2024-03-15 21:55:16
|
||||
modified: 2024-03-16 18:39:20
|
||||
tags:
|
||||
title: 数据处理过程
|
||||
---
|
||||
@@ -265,10 +265,7 @@ data['日期'] = pd.to_datetime(data['日期'])
|
||||
|
||||
# Add a 'YearMonth' column for easier analysis
|
||||
data['YearMonth'] = data['日期'].dt.to_period('M')
|
||||
|
||||
# Group data by 'YearMonth'
|
||||
grouped = data.groupby('YearMonth')
|
||||
|
||||
|
||||
# Assuming 'data' is your DataFrame and '支付方式' is the column for Payment Methods
|
||||
data['Payment Category'] = data['支付方式'].apply(lambda x: '挂账' if '挂账' in str(x).lower() else '现付')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user