使用tqdm给pandas显示进度条


def query_grading_result(df):
  return df['result']

if __name__ == "__main__"
    df = pd.read_csv('data/dab57f08-9fac-4ada-bf80-f72bf51bbc0a.csv')

    from tqdm import tqdm
    tqdm.pandas(desc='apply')

    df['grading_result'] = df.progress_apply(query_grading_result, axis=1)

    df.to_csv(f'output/grading_result_1102.csv')
posted @ 2023-11-02 17:39  致林  阅读(187)  评论(0编辑  收藏  举报