Optimizing Memory Usage in Python (Pandas)

Authors

  • Giorgi Kuchava Business And Technology University, Tbilisi, Georgia Author
  • Maia Mantskava Ivane Beritashvili Center of Experimental Biomedicine, Tbilisi, Georgia Author
  • Nana Momtselidze Kutaisi University, Kutaisi, Georgia Author

DOI:

https://doi.org/10.51231/2667-9507-2024-007-03-76-79

Keywords:

Python Programming, Pandas Library, Memory Optimization, Data Science, Data Analytics, Machine Learning

Abstract

This article explores Python's prominence in Data Science, Data Analytics, and his article explores Python's prominence in Data Science, Data Analytics, and Machine Learning, attributing its widespread adoption to its user-friendly na- achine Learning, attributing its widespread adoption to its user-friendly nature, robust online community, and powerful data-centric libraries such as Pan- ure, robust online community, and powerful data-centric libraries such as Pandas, NumPy, and Matplotlib. It delves into the challenges of managing extensive as, NumPy, and Matplotlib. It delves into the challenges of managing extensive datasets and emphasizes the importance of memory utilization in navigating atasets and emphasizes the importance of memory utilization in navigating substantial data. The Pandas library's info() and memory_usage() methods are ubstantial data. The Pandas library's info() and memory_usage() methods are discussed as essential tools for assessing and optimizing dataframe memory con- iscussed as essential tools for assessing and optimizing dataframe memory consumption. The article demonstrates how changing data types, particularly for umption. The article demonstrates how changing data types, particularly for object columns, to the category datatype signi bject columns, to the category datatype significantly reduces memory usage cantly reduces memory usage without altering the dataframe's appearance. The strategic adjustment of numer- ithout altering the dataframe's appearance. The strategic adjustment of numerical column data types based on value range, illustrated with the age column as cal column data types based on value range, illustrated with the age column as an example, is explored as a means of achieving precision and memory ef n example, is explored as a means of achieving precision and memory efficiency. The article highlights the considerable reduction in memory requirements y. The article highlights the considerable reduction in memory requirements by transitioning from y transitioning from fl oat64 to oat64 to float16 for columns containing oat16 for columns containing floating-point oating-point numbers. Overall, this comprehensive exploration provides valuable insights umbers. Overall, this comprehensive exploration provides valuable insights into effective strategies for memory optimization in Pandas dataframes, catering nto effective strategies for memory optimization in Pandas dataframes, catering to both categorical and numerical data, contributing to enhanced computational o both categorical and numerical data, contributing to enhanced computational efficiency and signi ciency and significant memory savings.

Downloads

Download data is not yet available.

Downloads

Published

19.03.2026

How to Cite

Share