πŸ“… 2023-08-20 β€” Session: Styled DataFrames with Bars and Notation

πŸ•’ 06:40–07:15
🏷️ Labels: Pandas, Dataframe, Visualization, Python, Styling
πŸ“‚ Project: Dev
⭐ Priority: MEDIUM

Session Goal: The primary goal of this session was to enhance the visualization of data within Pandas DataFrames by applying various styling techniques, including horizontal bars and scientific notation.

Key Activities:

  • Implemented a code snippet to style Pandas DataFrame cells with gray bars normalized against a common maximum value.
  • Resolved an import error by ensuring matplotlib.pyplot was correctly imported for plotting purposes.
  • Developed a function to style DataFrames using horizontal bars, proportional to the maximum absolute value.
  • Applied scientific notation styling to DataFrame numbers using the Styler object from Pandas.
  • Created a custom function for engineering notation formatting within DataFrames, enhancing visual representation.
  • Extracted specific data from a multi-indexed DataFrame using the loc indexer, focusing on β€˜Union Por La Patria’.
  • Designed a function to compare cargo tags in voting data, demonstrating its application through example scenarios.

Achievements:

  • Successfully styled DataFrames with horizontal bars and scientific/engineering notation, improving data visualization.
  • Resolved import issues, ensuring smooth execution of plotting functions.

Pending Tasks:

  • Further testing and validation of the custom styling functions with different datasets to ensure robustness.