正如标题所示,我正在尝试在执行
我有以下脚本:
pandas.to_csv
时显示进度条。我有以下脚本:
def filter_pileup(pileup, output, lists):
tqdm.pandas(desc='Reading, filtering, exporting', bar_format=BAR_DEFAULT_VIEW)
# Reading files
pileup_df = pd.read_csv(pileup, '\t', header=None).progress_apply(lambda x: x)
lists_df = pd.read_csv(lists, '\t', header=None).progress_apply(lambda x: x)
# Filtering pileup
intersection = pd.merge(pileup_df, lists_df, on=[0, 1]).progress_apply(lambda x: x)
intersection.columns = [i for i in range(len(intersection.columns))]
intersection = intersection.loc[:, 0:5]
# Exporting filtered pileup
intersection.to_csv(output, header=None, index=None, sep='\t')
在前几行中,我找到了一种集成进度条的方法,但是这种方法对于最后一行无效。我如何实现呢?
.write
调用,同时更新进度条。虽然我不建议这样做,所以我不会将其发布为答案。 - orlpdask.diagnostics
下自带有进度条。 - Eliran Turgeman