4. The Four Dimensions of Exploratory Data Analysis#

Exploration is the central activity of EDA. Although it is tempting to treat it as a series of standard plots or checklists, effective exploration is better understood as a set of four complementary perspectives on a dataset. Each dimension highlights different aspects of structure, quality, behavior, and risk. Analysts move fluidly among these dimensions, since patterns revealed in one often raise questions that must be investigated through another.

Throughout this section, we illustrate concepts using the Dirty Café dataset. Even a brief look at a few sample rows reveals the kinds of irregularities that are common in real operational data:

T100001,COFFEE,5,comp,$14.95,Debit,Grubhub,Downtown Durham café,2023/08/20 09:41:20 EDT, Name=Quinn King;Phone=919-705-2489;Tier=Silver
T100002,café coffee,-2,2.94, 2.94 ,credit card,grub hub,Apex,08/02/2023 11:17 AM,Garrett Golden <garrett.golden255@example.com> (Student)
T100003,sandwich,5,"6,91", 34.55 ,Cash,grub hub,"Cary, NC",2023-09-27 09:17 -0500," Gray, Phoenix | 919-947-8527 | Bronze"

Here we see inconsistent formatting, negative quantities, mixed timestamp conventions, heterogeneous location strings, irregular pricing, and nested customer details encoded in multiple formats. These issues do not merely complicate cleaning; they fundamentally shape how exploratory reasoning must proceed. The four dimensions below provide a structured way to examine datasets like this and uncover the patterns, problems, and opportunities they contain.


4.1 Distributional Exploration (Univariate)#

Distributional exploration focuses on understanding each variable on its own. Before examining relationships or trends, analysts must first understand the scale, shape, and validity of each field. This involves far more than plotting a histogram. It requires reasoning about what values mean in context, detecting anomalies, and considering what patterns suggest about upstream system behavior.

orders = (
    df.groupby("Transaction ID", as_index=False)
      .agg(
          timestamp=("Datetime_UTC", "min"),
          total_revenue=("Total_Spent", "sum"),
          items=("Quantity", "sum"),
          payment_method=("Payment_Method", "first"),
          order_method=("Order_Method", "first"),
          location=("Location", "first"),
          # is_campus=("Is Campus Location", "first")
      )
)

# And add, date, weekday, and hour columns
orders["date"] = orders["timestamp"].dt.date
orders["weekday"] = orders["timestamp"].dt.day_name()
orders["hour"] = orders["timestamp"].dt.hour
orders.head()

Then show the distribution plot. Then explain different options with filtering to just 50 and then the log.

Analytical purpose#

Distributional exploration helps analysts:

  • Identify valid ranges and detect impossible or inconsistent values

  • Characterize shape, skewness, multimodality, and heavy tails

  • Detect truncation, censoring, and structural zeros

  • Understand missingness patterns and potential mechanisms

  • Anticipate transformations or encodings needed for modeling

In financial contexts, distributions often exhibit long tails, strong skew, and mixture patterns created by heterogeneous customer behaviors or product categories.

Dirty Café example#

Consider the quantity field:

df["Quantity"].hist()

The resulting histogram immediately reveals unusual values, such as negative quantities. A negative count might represent a return or adjustment, but given the informality of the dataset, it may also indicate a data-entry or ingestion error. Distributional EDA surfaces these questions before modeling decisions are made.

Price-per-unit contains even more irregularities:

  • "comp" instead of a numeric value

  • "6,91" using a comma as the decimal separator

  • Extra whitespace or currency symbols

  • Values that do not align with the recorded total

These distributional anomalies signal that price-related fields require careful cleaning and possibly recoding logic based on item categories or operational rules.

Total spent has its own issues: values such as 2.94 include whitespace, and comparisons against calculated totals suggest inconsistencies. Detecting these issues at the univariate level prevents the analyst from drawing erroneous conclusions in later relational or comparative analyses.

Interpretation considerations#

Distributional anomalies can reflect real behaviors or errors. Heavy tails may reflect genuine events (large group orders), while bimodal patterns may indicate different product mixes. Analysts must avoid treating all outliers as noise. Instead, distributional EDA encourages curiosity: Why does this pattern exist? What process might produce it? Responses to these questions frame subsequent exploration.


4.2 Relational Exploration (Bivariate and Multivariate)#

Relational exploration examines how variables interact. Whereas distributional EDA considers fields independently, relational EDA investigates the joint behavior of variables. This is often where early insight into drivers, segment differences, and data quality problems emerges.

Analytical purpose#

Relational exploration helps analysts:

  • Identify correlations, nonlinearities, thresholds, and discontinuities

  • Surface feature interactions and potential confounders

  • Detect redundancy or multicollinearity

  • Discover anomalies that require provenance checks

  • Assess whether patterns differ across segments or conditions

Financial and operational systems often contain subtle interdependencies. For example, payment channel may interact with time of day, or device type may interact with user tenure in fraud detection.

Dirty Café example#

A simple relational check is to compare calculated totals against recorded totals:

df["calc_total"] = df["Quantity"] * df["Price Per Unit"]
sns.scatterplot(data=df, x="calc_total", y="Total Spent"])

If the two totals align, points should fall along a diagonal. In the Dirty Café dataset, the relationship is noisy. Some discrepancies come from data-entry errors, others from price-per-unit contamination, and others from irregular discounts or the use of the “comp” indicator.

Another relational question concerns category drift. The order-channel field appears as both "Grubhub" and "grub hub". A simple frequency plot reveals the inconsistency:

df["Order Method"].value_counts()

From an exploratory perspective, this signals that downstream analyses involving order method may be misinterpreted unless categories are standardized.

Relational exploration also highlights segmentation needs. If tip percentage varies by customer tier, or if spend patterns differ by location, analysts may need to reconsider whether a single model or summary can describe all segments accurately.

Interpretation considerations#

Patterns seen in relational plots should not be treated as evidence. Apparent relationships often vanish when controlling for other variables or appear only in specific segments. Analysts must recognize when relational EDA reveals potential confounders or leakage and follow up accordingly.


4.3 Structural Exploration (Temporal, Hierarchical, Sequential, Geospatial)#

Structural exploration examines patterns that arise not from individual variables, but from the dataset’s inherent structure. Financial datasets typically contain strong temporal, hierarchical, or sequential organization, and failing to understand these structures leads to incorrect modeling assumptions or misinterpretation of trends.

Analytical purpose#

Structural exploration helps analysts:

  • Validate temporal ordering, time-zone consistency, and latency

  • Identify trends, seasonality, drift, and abrupt regime changes

  • Understand hierarchical relationships such as customer to account to transaction

  • Study event sequences and behavioral funnels

  • Identify spatial or location-driven variation

These structural patterns often determine whether certain modeling strategies are feasible. For example, the presence of drift may prevent the use of stationary assumptions, while sequential behavior may require event-level analysis.

Dirty Café example#

The three sample timestamps reveal structural issues immediately:

  • 2023/08/20 09:41:20 EDT

  • 08/02/2023 11:17 AM

  • 2023-09-27 09:17 -0500

These formats differ in ordering, delimiters, and time-zone representation. Attempting to sort them chronologically would fail without preprocessing.

df["Transaction Datetime"].sort_values().head()

Structural EDA also examines periodicity. Even without fully cleaned timestamps, grouping by day-of-week reveals operational cycles:

df.groupby("weekday")["Total Spent"].mean()

Hierarchical structure also matters. Customers may appear in multiple locations or across order channels. Understanding these structures is essential for interpreting relational or comparative patterns.

Sequence analysis can reveal precursor events, such as a small transaction followed by a larger one, a pattern common in fraud activity. While the Dirty Café dataset is simple, structural EDA still uncovers temporal gaps or ordering inconsistencies that must be resolved before modeling.

Interpretation considerations#

Structural patterns must be interpreted carefully. A spike in transactions at a particular time may reflect a system outage earlier in the day rather than a true behavioral change. Time-zone drift may create artificial seasonality. Analysts must remain cautious and verify whether observed structure reflects real-world behavior or data-collection artifacts.


4.4 Comparative Exploration (Cohorts and Regimes)#

Comparative exploration studies differences across groups, periods, or conditions. In FinTech settings, this mode is essential because many analytic questions involve comparisons: before and after policy changes, across customer segments, or between different market regimes.

Analytical purpose#

Comparative exploration helps analysts:

  • Detect structural breaks or distribution shifts

  • Identify heterogeneous effects across subpopulations

  • Support pre–post analysis

  • Assess segment-level stability for modeling

  • Surface fairness, compliance, or representational issues

Comparative EDA is often where the analyst discovers that a single global summary masks important subgroup variation.

Dirty Café example#

Customer details show several tiers: Silver, Bronze, Student. Examining spend across these tiers illustrates relative patterns:

sns.boxplot(data=df, x="Tier", y="Total Spent"])

Differences across order channels or locations may indicate inconsistent data capture or operational heterogeneity. If a menu change was introduced in September, comparing spending before and after that date highlights possible impacts.

Comparative EDA also supports drift detection. If average spend or order frequency changes sharply mid-month, structural EDA should be revisited to understand the underlying cause.

Interpretation considerations#

Comparative differences do not imply causation. A shift in average spend after a menu change may reflect seasonality rather than the change itself. Differences across user segments may reflect selection mechanisms rather than behavioral differences. Analysts must treat comparative results as exploratory evidence that guides further investigation, not as final conclusions.


4.5 Iteration Across Dimensions#

Although presented as separate sections, the four dimensions of EDA are highly interconnected. Analysts rarely proceed in a strict order. Instead:

  • Distributional anomalies prompt relational checks

  • Relational patterns reveal structural dependencies

  • Structural shifts prompt comparative analysis

  • Comparative differences raise questions that return to distributional or relational exploration

This iterative interplay reflects the scientific method and is essential in dynamic financial environments. The goal is not to produce a fixed set of plots, but to build a coherent understanding of the dataset that supports accurate interpretation and reliable next steps.