Making a good visualization is a sequence of stages. Skipping one produces misleading or useless charts.
Stage 1: Data Collection
The process begins with the question to be answered and the audience. Data are then collected from files (Excel, CSV), databases, web services, sensors or surveys. Good practice is to note the source, date and meaning of every field, because a chart is only as reliable as its data.
Stage 2: Data Exploration and Preparation
Next the data are inspected: how many rows, which types, what ranges. Cleaning removes duplicates, fixes wrong types, handles missing values and corrects inconsistent entries such as "Delhi" and "delhi". Transformation reshapes the data, for example splitting a date into year and month, or combining tables. This stage often takes most of the project time.
Stage 3: Analysis
The prepared data are analysed to find the answer: totals, averages, percentages, growth rates, rankings and correlations. These calculations are measures that will be plotted. Analysis decides what the chart must show.
Stage 4: Visualization
The designer chooses the chart type that fits the data type and the message, maps the data to visual encodings (position, length, colour, size), and applies clear titles, labels and a consistent style. Several versions may be tried and the clearest kept.
Stage 5: Interpretation and Communication
Finally the result is interpreted: what does the chart say, and what should be done? The finding is communicated with a title that states the message and a short explanation. Feedback from the audience may send the work back to an earlier stage, so the process is iterative.
Definition: Data visualization process. The sequence of stages from collecting data, exploring and preparing it, analysing it and visualizing it, to interpreting and communicating the result.
Table 1.4: Stages of the process
| Stage | Main activity | Output |
|---|---|---|
| Collection | Gather data from sources | Raw dataset |
| Exploration | Clean and prepare | Tidy dataset |
| Analysis | Compute measures and patterns | Numbers to show |
| Visualization | Choose chart and design | Chart or dashboard |
| Interpretation | Explain and communicate | Decision or action |
Example 1.4: Cleaning before charting
Problem: Sales by city are Delhi 100, delhi 50, Mumbai 200, Mumbai 40 and a missing city with 30. Clean the data and give the totals to chart.
Solution:
- Standardise the case: delhi becomes Delhi.
- Group duplicate cities: Delhi = 100 + 50 = 150 and Mumbai = 200 + 40 = 240.
- The row with a missing city (30) is kept as "Unknown" so that the grand total of 420 is preserved and not silently lost.
- The chart will show Mumbai 240, Delhi 150 and Unknown 30.
Result: Cleaned totals Mumbai 240, Delhi 150, Unknown 30 (total 420).
import pandas as pd
raw = pd.DataFrame({
"City": ["Delhi", "delhi", "Mumbai", "Mumbai", None],
"Sales": [100, 50, 200, 40, 30]})
raw["City"] = raw["City"].fillna("Unknown").str.title()
clean = raw.groupby("City")["Sales"].sum()
print(clean.sort_values(ascending=False).to_string())
print("Total:", clean.sum())
Output
City
Mumbai 240
Delhi 150
Unknown 30
Total: 420
Common mistakes
- Charting raw data without cleaning it first.
- Starting without a clear question or audience.
- Dropping rows with missing values without noticing the effect on totals.
- Treating the process as a one-way line instead of iterating.
Key takeaways
- Stages: collect, explore and prepare, analyse, visualize, interpret.
- Data preparation takes much of the effort.
- Begin with the question and the audience.
- The process is iterative.
Practice questions
- List the five stages of the process.
- Why clean data before charting?
- What is done in the analysis stage?
Answers to the practice questions
- Collection, exploration and preparation, analysis, visualization, interpretation.
- Errors, duplicates and inconsistencies produce wrong or misleading charts.
- Computing the measures such as totals, averages and growth that will be shown.
Sources
- Official BCA syllabus Data Visualization, course code 26BCA404DSE11, Unit I
