颜色分类leetcode磁盘故障预测只针对阿里巴巴AIOps岗位面试的编码测试。扫描当前目录下的所有CSV文件:


import pandas as pd

import glob, os, sys



input_path = './'

output_file = 'pandas_union_concat.csv'

all_files = glob.glob(os.path.join(input_path, 'sales_*'))

all_data_frames = []

for file in all_files:

    data_frame = pd.read_csv(file, index_col=None)

    total_sales = pd.DataFrame([float(str(value).strip('$').replace(',', '')) for value in data_frame.loc[:, 'Sale Amount']]).sum()

    average_sales = pd