Skip to content

Commit e935f62

Browse files
committed
提交代码
1 parent 6693099 commit e935f62

File tree

93 files changed

+30
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+30
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

xianhuan/.DS_Store

0 Bytes
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
@author: 闲欢
5+
"""
6+
import pandas as pd
7+
import os
8+
9+
result = pd.DataFrame()
10+
11+
for name in os.listdir("./tables"):
12+
try:
13+
df = pd.read_excel("./tables/" + name)
14+
df['销售额'] = df['访客数'] * df['转化率'] * df['客单价']
15+
df_sum = df.groupby('品牌')['销售额'].sum().reset_index()
16+
result = pd.concat([result, df_sum])
17+
except:
18+
print(name)
19+
pass
20+
21+
final = result.groupby('品牌')['销售额'].sum().reset_index().sort_values('销售额', ascending=False)
22+
pd.set_option('display.float_format', lambda x: '%.2f' % x)
23+
print(final.head())
24+
25+
26+
27+
28+
29+
30+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)