我将不同的CSV文件作为数据帧加载到内存中,这可能会导致OutOfMemory错误。我一次把它们都装进去,因为我要做连接操作
有没有办法避免一次将所有文件加载到内存中
myfiles= load_all_files(mypath)
myfiles.df1 = myfiles.df1\
.query("IdType not in ['A','B','C']")\
.drop(columns='IdType')\
.groupby('IdGroup')\
.agg('sum')\
.join(myfiles.df2)\
.groupby('IdV')\
.agg('sum')
myfiles.d3 = myfiles.df3\
.query("IdType not in [1,2,3]")\
.drop(columns='IdType')\
.groupby('IdGroup')\
.agg('sum')\
.join(myfiles.df4)\
.groupby('IdV')\
.agg('sum')
# other similar operations
目前没有回答
相关问题 更多 >
编程相关推荐