π 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.