Last active
October 16, 2020 10:01
-
-
Save bfgits/3ee00e6ac80377fb268b7bf5094649a5 to your computer and use it in GitHub Desktop.
analyze_aliyun_fee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
''' | |
@File : analyze_aliyun_fee | |
@Date : 16/10/2020 2:53 PM | |
@Desc : | |
''' | |
import pandas as pd | |
def analyze_aliyun_fee(input_file=None): | |
# 统计阿里云各服务费用占比 | |
# 从阿里云费用中心->收支明细下载所有的消费记录进行统计 | |
chunks = pd.read_csv(input_file, chunksize=100000) | |
data = pd.concat(chunks) | |
print(data.groupby(['交易备注'])['金额'].sum()) | |
if __name__ == '__main__': | |
analyze_aliyun_fee(input_file='./aliyun_fee.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment