python pandas處理大數據節省內存的方法

python pandas處理大數據節省內存的方法 數值類型的列進行降級處理 字符串類型的列轉化爲類別類型(category) 字符串類型的列的類別數超過總行數的一半時,建議使用object類型 ''' 減小內存的使用 ''' def reduce_mem_usage(df, verbose=True): numerics = ['int16', 'int32', 'int64', 'fl
相關文章
相關標籤/搜索