小编Pee*_*ahu的帖子

python中for循环的内存分配

我对python的内存使用感到困惑.我正在运行一个返回pandas数据帧的函数(1161 X 240),参数是(bamfile,pandas.Dataframe(1161 X 50)).

现在我将通过探查器给出内存使用情况:

Line #    Mem usage    Increment   Line Contents
================================================
   120  983.363 MiB    0.000 MiB   @profile
   121                             def overlapping_peaks_distribution(bam_peak1, overlap_df):
   122                                 '''
   123                                 Returns dataframe for tag count distribution for overlapping peaks within 500bp (+,-) from summit.
   124                                 This function also considers the gene transcrition direction.
   125                                 :param bam_peak1:
   126                                 :param overlap_df:
   127                                 :return:
   128                                 '''
   129  983.363 MiB    0.000 MiB       import pandas as pd
   130  983.363 MiB    0.000 MiB       import sys
   131  983.363 MiB    0.000 …
Run Code Online (Sandbox Code Playgroud)

python profiler memory-leaks memory-management

7
推荐指数
1
解决办法
704
查看次数