0
跟蹤工作進度,我用下面的代碼來跟蹤工作進度:的Python:使用tqdm
from tqdm import tqdm, tqdm_pandas
tqdm.pandas(tqdm())
my_df['target'] = my_df.progress_apply(lambda x: my_fun(x), axis = 1)
然後代碼提供進度跟蹤象下面這樣:
0%| | 0/5 [00:00<?, ?it/s]
20%|██ | 1/5 [00:06<00:26, 6.62s/it]
215it [00:06, 4.63s/it]
1062it [00:06, 3.24s/it]
1976it [00:06, 2.27s/it]
2893it [00:07, 1.59s/it]
3811it [00:07, 1.11s/it]
4720it [00:07, 1.28it/s]
5650it [00:07, 1.83it/s]
6585it [00:07, 2.62it/s]
7520it [00:07, 3.74it/s]
8444it [00:07, 5.35it/s]
9378it [00:07, 7.64it/s]
10311it [00:07, 10.90it/s]
11218it [00:07, 15.57it/s]
12111it [00:08, 22.22it/s]
13004it [00:08, 31.70it/s]
13832it [00:08, 45.20it/s]
14618it [00:08, 64.36it/s]
15404it [00:08, 91.62it/s]
16149it [00:08, 129.91it/s]
16870it [00:08, 184.16it/s]
17560it [00:08, 259.28it/s]
18315it [00:08, 365.02it/s]
19162it [00:09, 512.00it/s]
19891it [00:09, 706.09it/s]
:
:
我想知道是否可以每5秒打印一次信息,而不是每秒輸出10次?非常感謝!