liveBook · Manning

Visualization

As explained in Starting Data Analytics with Generative AI and Python

Data visualization is the graphical representation of data to communicate patterns, relationships, or distributions.

A table can contain the answer to a business question without making it easy to see. Visualization turns selected values into charts so you can inspect patterns, comparisons, and changes. Choose the chart for the question—not just because a plotting tool offers it. A table of sales by product category and region, for example, invites comparison; monthly review counts invite a search for changes over time. section 3.3.1 section 2.6.2

Start with the decision you are trying to inform:

  • To check whether activity changed, plot review counts by month. Look for phases, unusual values, and possible data-collection problems. An outlier might instead reflect a real business event, so investigate before cleaning it away. section 2.6.2
  • To compare product categories across regions, try grouped bar plots or heatmaps of sales volume and revenue. A wide DataFrame may hold the figures but make their differences hard to inspect. section 3.3.1
  • To examine whether review scores shift over time, group records by date or month, calculate each score’s proportion within the period, and plot the proportions as stacked bars. section 2.6.2

Ask for a chart, then test the answer

Given a regional sales DataFrame, ask an AI assistant: “Can you propose visualization methods for sales_by_region DataFrame, which would allow answering the posed research question?” Its suggestions can help you choose between bar plots and heatmaps, but run and inspect the generated Python. One attempted plot produced a deprecation warning and a `ValueError` because it could not interpret `customer_state`. Check the DataFrame’s actual columns and the chart’s readable output rather than accepting the proposed code or visual at face value. section 3.3.1

score_proportions.plot(kind='bar', stacked=True, figsize=(15, 6))
plt.xlabel('Month')
plt.ylabel('Proportion of Scores')
plt.title('Proportion of Review Scores Over Time (Monthly)')
plt.legend(title='Review Score', bbox_to_anchor=(1, 1))
plt.show()

This plotting step turns monthly review-score proportions into a stacked bar chart; inspect what the proportion axis says before drawing conclusions about raw review counts. section 2.6.2

Visualization belongs both to exploratory data analysis and to business analysis: revisit a chart as your understanding of the records changes. Use descriptive statistics and checks against the underlying data alongside the picture. A striking pattern can suggest a question, but a chart alone cannot establish its cause. section 2.6.2 section 3.3

How Starting Data Analytics with Generative AI and Python covers it

How deep it goes
Works through chart choices and Python plotting steps, then checks failures; does not develop visualization theory.
Examples
Shows monthly review counts, stacked review-score proportions, and regional product-sales bar plots and heatmaps.
What it assumes
Assumes acceptable data quality, understood field meanings, and a prepared DataFrame before charting business questions.
What you can do after
Apply it via pandas, Matplotlib, and seaborn to compare business data, inspect trends, and test generated plotting code.
How it connects
Connects visualization to exploratory data analysis, descriptive statistics, time-series analysis, data quality, and generative AI.

Also explained in

Compare how 16 books explain visualization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Starting Data Analytics with Generative AI and Python. The section links point to the parts of the book it draws on.