Lab / Data Visualization (Python, Plotly & Seaborn)
From one MySQL query to 9 ways of looking at the data
A connection to a relational database with credentials kept outside the code, loaded into pandas and explored visually. Seven statistical graphics in seaborn and matplotlib, plus two Plotly builds that render live rather than as images.
01 · Seaborn
Box plot with strip plot
The five-number summary with every individual observation jittered on top, so the box never hides the real shape of the distribution.
(open at original size)
02 · Seaborn
Two-way heat map
A cross-tabulation turned into colour, so the extreme combinations are found without reading a single figure.
(open at original size)
03 · Seaborn
Pair plot with density estimates
Every pair of variables at once, each one’s distribution on the diagonal, and a third categorical variable splitting all three levels.
(open at original size)
04 · Seaborn
Correlation matrix
Every cross-correlation in one view. Here the answer is that no relationship holds between the variables, and ruling relationships out is analysis too.
(open at original size)
05 · Seaborn
Joint plot with marginal distributions
The relationship between two variables in the centre and each one’s distribution in the margins, so the cloud is never read without knowing how it spreads.
(open at original size)
06 · Seaborn
Split violin plot with swarm overlay
Two density estimates mirrored on the same axis and, on top, every observation placed without overlap. Three layers of information in one space.
(open at original size)
07 · Seaborn
Faceted grid
The same chart repeated for each combination of two categorical variables, so differences between groups are read by direct comparison.
(open at original size)
08 · Plotly · interactive
Hierarchical treemap
Nested areas in proportion across three levels. Click a block to drill down and hover to read the exact value.
This chart is interactive and needs JavaScript.
09 · Plotly · interactive
Sankey diagram
Flows between origins and destinations, each ribbon as thick as its volume. Drag a node to rearrange the diagram and hover over a ribbon.
This chart is interactive and needs JavaScript.
Data extracted from MySQL with mysql-connector-python, credentials in a .env kept out of the repository. Charts in seaborn, matplotlib and plotly. The Power BI reports from the same programme include native visuals and script visuals that run Python inside the report itself. Full code at github.com/oriac-gimeno/Reskilling-Data-Analytics-IT-Academy (Opens in a new tab)
AI assistant
Answers come from an AI model reading a profile of Oriac. It can be wrong. For anything important, get in touch directly.
Questions and answers are kept for 90 days to improve the site, without your IP address or any identifier. Do not type personal data.