🌍 Data Science · subject

Data Science Data Wrangling and Exploration Syllabus

The Data Wrangling and Exploration syllabus for Data Science in full: 7 chapters and 33 topics, every one listed below, plus 50 Data Wrangling and Exploration flashcards with answers.

7Chapters
33Topics
50Flashcards

Data Wrangling and Exploration syllabus: all 7 chapters

Expand any chapter to see its topics and sub-topics.

  1. Data Collection

    4 topics
    • APIs and Web Scraping
    • Database Extraction
    • File Formats (CSV, JSON, XML)
    • Data Warehouses and Lakes
  2. Data Cleaning

    5 topics
    • Handling Missing Data
    • Data Type Conversion
    • Removing Duplicates
    • Outlier Detection and Treatment
    • Data Normalization and Standardization
  3. Data Transformation

    5 topics
    • Feature Engineering
    • Data Aggregation
    • Data Encoding (One-Hot, Label Encoding)
    • Date and Time Manipulation
    • Text Data Processing
  4. Data Integration

    4 topics
    • Merging Datasets
    • Joining Data
    • Concatenation
    • Handling Schema Mismatches
  5. Data Exploration

    5 topics
    • Descriptive Statistics
    • Data Visualization
    • Correlation Analysis
    • Hypothesis Testing
    • Exploratory Data Analysis (EDA)
  6. Tools and Libraries

    5 topics
    • Pandas
    • NumPy
    • Matplotlib
    • Seaborn
    • Scikit-learn
  7. Best Practices

    5 topics
    • Version Control for Data
    • Reproducibility
    • Documentation
    • Data Security and Privacy
    • Performance Optimization

Data Science Data Wrangling and Exploration flashcards — 50 questions with answers

  1. What is the primary purpose of a REST API in data collection?

    A REST (Representational State Transfer) API exposes data over HTTP using standard methods (GET, POST, PUT, DELETE) and returns structured responses (usually JSON), letting a program request specific data resources via URLs/endpoints without scraping HTML.

  2. In web scraping, what is the difference between an HTML parser and a headless browser?

    An HTML parser (e.g., BeautifulSoup, lxml) reads static HTML returned by an HTTP request. A headless browser (e.g., Selenium, Playwright) renders the page including JavaScript-generated content, so it is needed for dynamic sites where data loads after the initial HTML.

  3. What HTTP status code indicates a successful request, and which indicates rate limiting / too many requests?

    $200$ indicates success (OK). $429$ indicates 'Too Many Requests' (rate limiting). Other common ones: $404$ Not Found, $401$ Unauthorized, $403$ Forbidden, $500$ Server Error.

  4. What file is used to declare scraping permissions for a website, and what is its role?

    robots.txt, located at the site root, specifies which paths crawlers are allowed or disallowed from accessing. It is a voluntary standard guiding ethical scraping but is not technically enforced.

  5. What is pagination in the context of API extraction, and name two common schemes?

    Pagination splits large result sets into pages. Two common schemes: offset/limit (e.g., ?offset=100&limit=50) and cursor-based (a token pointing to the next page). Cursor-based is more stable for changing data.

  6. What SQL clause set is the minimal pattern to extract a filtered subset of columns from a database table?

    SELECT (columns) FROM (table) WHERE (condition). Example: SELECT name, age FROM users WHERE age >= 18.

  7. What is the difference between OLTP and OLAP database systems?

    OLTP (Online Transaction Processing) handles many short read/write transactions for operational apps. OLAP (Online Analytical Processing) is optimized for complex read-heavy analytical queries over large historical data, often with denormalized/star schemas.

  8. What is a database index and what trade-off does it introduce?

    An index is a data structure (often a B-tree) that speeds up row lookup on indexed columns, reducing query time from $O(n)$ scans toward $O(\log n)$. Trade-off: it consumes extra storage and slows down inserts/updates because the index must be maintained.

  9. Compare CSV, JSON, and XML formats in terms of structure.

    CSV: flat, tabular, comma-separated, no nesting. JSON: hierarchical key-value pairs and arrays, lightweight, native to web APIs. XML: hierarchical with tags and attributes, verbose, supports schemas (XSD) and namespaces.

  10. Why can parsing CSV be error-prone, and how is it handled?

    Fields may themselves contain the delimiter (comma) or newlines. This is handled by quoting fields (e.g., "New York, NY") and escaping embedded quotes by doubling them. A proper CSV parser respects quoting rather than naive splitting on commas.

  11. What is the key structural difference between a JSON object and a JSON array?

    A JSON object is an unordered set of key-value pairs enclosed in braces {}, e.g., {"a":1}. A JSON array is an ordered list of values enclosed in brackets [], e.g., [1,2,3]. Values can nest arbitrarily.

  12. What distinguishes a Data Warehouse from a Data Lake?

    A Data Warehouse stores structured, processed data with a predefined schema (schema-on-write) for BI/reporting. A Data Lake stores raw data in any format (structured, semi-structured, unstructured) with schema-on-read, offering flexibility but requiring more processing at query time.

  13. What is the ETL process and how does ELT differ?

    ETL = Extract, Transform, Load: data is transformed before loading into the warehouse. ELT = Extract, Load, Transform: raw data is loaded first (often into a data lake/cloud warehouse) and transformed afterward, leveraging the destination's compute power.

  14. What is a 'data lakehouse'?

    A data lakehouse is a hybrid architecture combining the low-cost, flexible raw storage of a data lake with the structure, schema enforcement, and ACID transaction management of a data warehouse (e.g., Delta Lake, Apache Iceberg).

  15. List the main mechanisms (missingness types) for missing data: MCAR, MAR, MNAR.

    MCAR (Missing Completely At Random): missingness unrelated to any data. MAR (Missing At Random): missingness depends on observed variables. MNAR (Missing Not At Random): missingness depends on the unobserved value itself. The type determines valid imputation strategies.

  16. What is mean/median imputation, and when is median preferred?

    It replaces missing numeric values with the column's mean or median. Median is preferred when the variable is skewed or has outliers, because the median is robust to extreme values whereas the mean is pulled toward them.

  17. What is listwise deletion and its main drawback?

    Listwise deletion (complete-case analysis) removes any row containing a missing value. Drawback: it can discard large amounts of data and introduce bias if the data is not MCAR, reducing statistical power.

  18. What is KNN imputation?

    KNN imputation fills a missing value using the values of the $k$ nearest neighbor rows (by distance over the other features), typically averaging the neighbors' values for that feature. It captures relationships between features but is computationally expensive on large data.

  19. Why is correct data type conversion (e.g., string to numeric or datetime) important before analysis?

    Operations behave differently by type: arithmetic and aggregation require numeric types, sorting differs for strings vs numbers, and time-based operations require datetime types. Wrong types cause errors or silently incorrect results (e.g., '10' < '9' as strings).

  20. What is the difference between explicit (downcasting) and implicit type coercion?

    Explicit conversion is programmer-directed casting (e.g., int(x), astype(float)). Implicit coercion is automatic type promotion by the language/library during mixed operations (e.g., int + float -> float). Implicit coercion can cause surprises like upcasting to object/string.

Show the other 30 Data Wrangling and Exploration flashcards
  1. How are duplicate records typically identified and removed in a dataset?

    Duplicates are identified by checking for rows with identical values across all columns or a chosen subset of key columns. They are removed by keeping the first or last occurrence (e.g., df.drop_duplicates(subset=..., keep='first')).

  2. What is the difference between exact duplicates and fuzzy (near) duplicates?

    Exact duplicates have identical values in compared fields. Fuzzy duplicates are records referring to the same entity but differing slightly (typos, formatting), requiring approximate matching like edit distance or similarity thresholds to detect.

  3. What is the IQR method for outlier detection, including the formula for the fences?

    Using quartiles $Q_1$ and $Q_3$ with $IQR = Q_3 - Q_1$, a point is an outlier if it lies below $Q_1 - 1.5 \times IQR$ or above $Q_3 + 1.5 \times IQR$.

  4. What is the z-score method for outlier detection and the common threshold?

    The z-score is $z = \frac{x - \mu}{\sigma}$. A point is commonly flagged as an outlier if $|z| > 3$. This assumes an approximately normal distribution.

  5. What is 'winsorization' as an outlier treatment?

    Winsorization caps extreme values at a specified percentile (e.g., values above the 95th percentile are set to the 95th-percentile value, and below the 5th to the 5th-percentile value). It limits outlier influence without deleting rows.

  6. Give the formula for min-max normalization and its output range.

    $$x' = \frac{x - x_{min}}{x_{max} - x_{min}}$$ It rescales values to the range $[0, 1]$ (or any chosen $[a,b]$ via scaling).

  7. Give the formula for z-score standardization and the resulting distribution properties.

    $$x' = \frac{x - \mu}{\sigma}$$ The standardized feature has mean $0$ and standard deviation $1$. It does not bound values to a fixed range.

  8. When should you prefer standardization over min-max normalization?

    Prefer standardization when the data is roughly Gaussian or when algorithms assume zero-centered data (e.g., PCA, SVM, logistic/linear regression with regularization). Min-max is preferred when you need a bounded range and the distribution is non-Gaussian (e.g., image pixels, some neural nets).

  9. What is robust scaling and when is it useful?

    Robust scaling uses the median and IQR: $$x' = \frac{x - \text{median}}{IQR}$$ It is useful when the data contains outliers, since median and IQR are robust to extreme values unlike mean and standard deviation.

  10. What is feature engineering?

    Feature engineering is the process of creating, transforming, or selecting input variables (features) from raw data to improve model performance — e.g., deriving ratios, polynomial terms, interaction terms, binning, or domain-specific aggregates.

  11. What is binning (discretization) and name two strategies?

    Binning converts a continuous variable into discrete intervals/categories. Two strategies: equal-width binning (intervals of equal range) and equal-frequency (quantile) binning (each bin holds roughly the same number of observations).

  12. What is a log transformation used for in feature engineering, and what is a caveat?

    A log transform, $x' = \log(x)$, compresses right-skewed data and reduces the effect of large values, often making distributions more symmetric. Caveat: it is undefined for $x \leq 0$, so a shift like $\log(x+1)$ (log1p) is used for zeros.

  13. What is data aggregation, and give an example with a SQL clause.

    Aggregation summarizes multiple rows into single values using functions (SUM, AVG, COUNT, MIN, MAX) over groups. Example: SELECT region, SUM(sales) FROM orders GROUP BY region — collapses rows per region into total sales.

  14. What does a GROUP BY operation conceptually do, and what is the role of HAVING vs WHERE?

    GROUP BY partitions rows into groups by key columns so aggregates compute per group. WHERE filters rows before grouping; HAVING filters groups after aggregation (e.g., HAVING SUM(sales) > 1000).

  15. What is a pivot (or crosstab) operation in data aggregation?

    A pivot reshapes data from long to wide format, turning unique values of one column into new columns and aggregating a value column at each row-column intersection — e.g., months as columns, products as rows, with summed sales in cells.

  16. What is one-hot encoding and what dimensionality does it produce for a categorical feature with k levels?

    One-hot encoding represents each category as a binary indicator column (1 if present, else 0). A feature with $k$ categories produces $k$ binary columns (or $k-1$ if one is dropped to avoid the dummy-variable trap).

  17. What is label encoding and a key risk when using it with non-tree models?

    Label encoding maps each category to an integer (e.g., red=0, green=1, blue=2). Risk: it imposes an artificial ordinal/numeric relationship, so distance- or linear-based models may wrongly infer blue > green > red. It is safe for tree-based models.

  18. What is the 'dummy variable trap' and how is it avoided?

    The dummy variable trap is perfect multicollinearity that occurs when one-hot columns are linearly dependent (they sum to 1). It is avoided by dropping one category column (using $k-1$ dummies), so no column is a linear combination of the others.

  19. Contrast one-hot encoding with target (mean) encoding.

    One-hot creates a binary column per category, increasing dimensionality. Target encoding replaces each category with a statistic of the target (e.g., mean target value for that category), keeping a single column but risking target leakage and overfitting; it needs cross-validation/smoothing.

  20. Why is parsing strings into a proper datetime type important, and name a common pitfall.

    Datetime types enable correct sorting, arithmetic (differences, offsets), and extraction of components. A common pitfall is ambiguous formats like 03/04/2025 (DD/MM vs MM/DD), so an explicit format/locale must be specified to avoid silent misparsing.

  21. What is the difference between a timezone-naive and timezone-aware timestamp?

    A naive timestamp has no timezone information and is ambiguous about the absolute instant. An aware timestamp carries timezone/UTC-offset info, allowing correct conversion between zones and unambiguous ordering across regions.

  22. What are common datetime feature extractions for modeling?

    From a timestamp you can derive year, month, day, day-of-week, hour, quarter, is_weekend, is_holiday, and elapsed time since an event. Cyclical features (hour, month) are often encoded with sine/cosine: $\sin\!\left(\frac{2\pi t}{T}\right)$ and $\cos\!\left(\frac{2\pi t}{T}\right)$.

  23. What is tokenization in text data processing?

    Tokenization splits raw text into smaller units (tokens) — typically words, subwords, or characters. It is the first step that turns a string into a sequence of discrete elements for further processing or vectorization.

  24. Differentiate stemming from lemmatization.

    Stemming crudely chops word endings to a root form (e.g., 'studies' -> 'studi') using rules, possibly producing non-words. Lemmatization maps a word to its dictionary base form (lemma) using vocabulary and part-of-speech (e.g., 'studies' -> 'study'), which is more accurate but slower.

  25. What is the TF-IDF weighting scheme and its formula?

    TF-IDF weights a term by its frequency in a document against its rarity across the corpus: $$\text{tfidf}(t,d) = tf(t,d) \times \log\frac{N}{df(t)}$$ where $N$ is the number of documents and $df(t)$ the number containing term $t$. Common words get low weight; distinctive words get high weight.

  26. What are stop words and why are they often removed?

    Stop words are extremely common words (the, is, and, of) that carry little discriminative meaning. They are often removed to reduce dimensionality and noise, though they can be retained when word order/context matters (e.g., for some deep models).

  27. What is the difference between concatenation and merging/joining of datasets?

    Concatenation stacks datasets along an axis (rows or columns) by position without matching keys. Merging/joining combines datasets by matching values in key columns, aligning rows based on relationships rather than position.

  28. Compare INNER, LEFT, RIGHT, and FULL OUTER joins.

    INNER: only rows with matching keys in both tables. LEFT: all rows from the left table plus matches from the right (nulls where no match). RIGHT: all rows from the right plus matches from the left. FULL OUTER: all rows from both, matched where possible, nulls elsewhere.

  29. What is a cross join (Cartesian product) and how many rows does it produce?

    A cross join pairs every row of one table with every row of the other, with no join condition. For tables of $m$ and $n$ rows it produces $m \times n$ rows.

  30. What is a schema mismatch when combining datasets, and name two common causes and a fix.

    A schema mismatch occurs when datasets to be combined have incompatible structures. Common causes: differing column names for the same concept (e.g., 'DOB' vs 'birth_date') and differing data types/units. Fixes: rename/map columns to a common schema and cast types/units to align before merging.

Data Science Data Wrangling and Exploration FAQ

What is in the Data Science Data Wrangling and Exploration syllabus?

Data Science Data Wrangling and Exploration is split into 7 chapters: Data Collection, Data Cleaning, Data Transformation, Data Integration, Data Exploration, Tools and Libraries and Best Practices. Together they contain 33 topics.

How many chapters are in Data Science Data Wrangling and Exploration?

7 chapters, containing 33 topics. The largest chapter is Data Cleaning, with 5 topics.

Are there flashcards for Data Science Data Wrangling and Exploration?

Yes — a 50-card Data Wrangling and Exploration deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.