显示效果如下
# tqdm搭配progress_apply使用 from tqdm import tqdm tqdm.pandas(desc='pandas bar') df_result = df['score'].progress_apply(lambda x: str(x)[0:7])