Data Preprocessing: Cleaning, Transforming, and Preparing Your Data
Learn how to clean messy data, handle missing values, encode categorical variables, normalize numbers, and prepare your dataset for analysis or machine learning.
Data Preprocessing: Cleaning, Transforming, and Preparing Your Data
Raw data is almost never ready for analysis. Before you can build charts, run statistical tests, or train machine learning models, you need to preprocess your data — clean it, fix errors, fill gaps, and convert it into a format the platform can work with.
This guide walks you through every preprocessing step available in the platform.
---
Why Preprocessing Matters
| Raw Data Problem | What Happens Without Fixing | Preprocessing Solution |
|---|---|---|
| Missing values | Models crash or give wrong results | Imputation or removal |
| Inconsistent text | "USA", "usa", "United States" treated as different | Standardization |
| Outliers | Averages get skewed | Detection and handling |
| Wrong data types | Numbers stored as text cannot be used in math | Type conversion |
| Duplicate rows | Results get inflated | Deduplication |
| Unscaled features | ML algorithms favor larger numbers | Normalization / scaling |
The Preprocessing Workspace
- Go to Preprocessing in the sidebar (or open it from a dataset)
- Select your dataset from the dropdown
- You will see three areas:
Changes apply in real time, and you can undo any step.
---
Step 1: Inspect Your Data
Before changing anything, look at your data:
- Row count — How many records do you have?
- Column count — How many fields?
- Data types — Are numbers stored as numbers? Are dates recognized?
- Missing values — How many gaps per column?
- Unique values — How many distinct values per column?
---
Step 2: Handle Missing Values
Missing values are cells without data. They appear as blank, null, NaN, or N/A.
Options for Handling Missing Values
| Strategy | When to Use | How It Works |
|---|---|---|
| Drop rows | Few missing rows (<5%) | Remove entire rows with any missing value |
| Drop columns | Column is mostly empty (>50% missing) | Remove the entire column |
| Fill with mean | Numeric columns, normally distributed | Replace gaps with the column average |
| Fill with median | Numeric columns, skewed data | Replace gaps with the middle value |
| Fill with mode | Categorical columns | Replace gaps with the most common value |
| Fill with constant | When you know a default value | Replace gaps with a fixed value (e.g., 0, "Unknown") |
| Forward fill | Time series or ordered data | Copy the previous row's value |
| Backward fill | Time series or ordered data | Copy the next row's value |
| KNN imputation | Complex patterns, many features | Predict missing values from similar rows |
How to Use
- Select the column with missing values
- Choose Handle Missing from the operations panel
- Pick a strategy
- Preview the result
- Apply
---
Step 3: Remove Duplicates
Duplicate rows can inflate counts and skew results.
- Select Remove Duplicates from the operations panel
- Choose which columns to consider (all columns or a subset)
- Preview how many duplicates were found
- Apply to remove them
---
Step 4: Fix Data Types
Columns sometimes have the wrong type. For example:
- A "price" column stored as text because it contains "$" symbols
- A "date" column stored as text because the format was not recognized
- A "zip code" column stored as a number (leading zeros are lost)
Changing Column Types
- Click the column header
- Select Change Type
- Choose: Numeric, Text, Date, Boolean
- Preview the conversion
- Apply
Common Fixes
| Problem | Fix |
|---|---|
| "$1,234.56" is text | Remove "$" and "," first, then convert to numeric |
| "01/15/2025" is text | Convert to date with format MM/DD/YYYY |
| "True"/"False" is text | Convert to boolean |
| Zip codes lose leading zeros | Keep as text, do not convert to numeric |
Step 5: Standardize Text
Text data often has inconsistencies that cause problems in analysis:
| Issue | Example | Fix |
|---|---|---|
| Mixed case | "New York", "new york", "NEW YORK" | Convert to lowercase or title case |
| Extra spaces | " John Smith " | Trim whitespace |
| Inconsistent labels | "M", "Male", "male" | Map to a single value |
| Special characters | "Café", "cafe\u0301" | Normalize Unicode |
How to Use
- Select the text column
- Choose Text Operations from the panel
- Apply: Lowercase, Trim, Replace, or Map values
- Preview and apply
Step 6: Handle Outliers
Outliers are values that are unusually far from the rest of the data. They can distort averages and mislead models.
Detection Methods
| Method | How It Works | Best For |
|---|---|---|
| IQR (Interquartile Range) | Values below Q1 - 1.5IQR or above Q3 + 1.5IQR | General purpose, robust to skew |
| Z-Score | Values more than 2-3 standard deviations from the mean | Normally distributed data |
| Visual (Box Plot) | Points beyond the whiskers | Quick visual check |
Handling Options
| Option | When to Use |
|---|---|
| Remove | Clear data errors (e.g., age = 999) |
| Cap (Winsorize) | Replace extreme values with a threshold |
| Transform | Apply log or square root to reduce skew |
| Keep | Outliers are real and meaningful (e.g., a genuine large transaction) |
Step 7: Encode Categorical Variables
Machine learning models need numbers, not text labels. Encoding converts categories to numbers.
| Method | When to Use | Example |
|---|---|---|
| One-Hot Encoding | Few categories (2-10), no order | Color: Red → [1,0,0], Blue → [0,1,0] |
| Label Encoding | Ordered categories | Size: S=1, M=2, L=3, XL=4 |
| Target Encoding | High-cardinality categories | City → average target value per city |
| Frequency Encoding | When count matters | Category → count of occurrences |
How to Use
- Select the categorical column
- Choose Encode from operations
- Pick the encoding method
- Preview and apply
---
Step 8: Scale and Normalize Numeric Features
When numeric columns have very different ranges (e.g., age 0-100 vs. salary 20000-200000), ML algorithms can give unfair weight to larger numbers.
| Method | Formula | When to Use |
|---|---|---|
| Min-Max Scaling | (x - min) / (max - min) | Scales to 0-1 range, good for most cases |
| Z-Score (Standard) | (x - mean) / std | Centers around 0, good for normally distributed data |
| Robust Scaling | (x - median) / IQR | Good when outliers are present |
| Log Transform | log(x) | Highly skewed data (e.g., income, prices) |
How to Use
- Select the numeric column(s)
- Choose Scale / Normalize from operations
- Pick the method
- Preview and apply
Step 9: Create New Features (Optional)
Sometimes you can create better columns from existing ones:
| New Feature | Source | Example |
|---|---|---|
| Age group | Age | 0-18, 19-35, 36-55, 56+ |
| Day of week | Date | Monday, Tuesday, etc. |
| Total | Price + Tax + Shipping | Combined value |
| Ratio | Revenue / Cost | Profit margin |
| Text length | Text column | Number of characters |
---
Preprocessing Workflow Summary
Load Dataset
↓
Inspect (types, missing, duplicates, stats)
↓
Remove Duplicates
↓
Fix Data Types
↓
Handle Missing Values
↓
Standardize Text
↓
Handle Outliers
↓
Encode Categoricals
↓
Scale / Normalize
↓
(Optional) Create New Features
↓
Ready for Analysis / ML
---
Quick Reference
| Task | Operation |
|---|---|
| Fill missing values | Handle Missing → Mean / Median / Mode / Constant |
| Remove duplicates | Remove Duplicates → Select columns |
| Change column type | Column header → Change Type |
| Lowercase text | Text Operations → Lowercase |
| Remove outliers | Outlier Detection → Remove / Cap |
| One-hot encode | Encode → One-Hot |
| Scale to 0-1 | Scale → Min-Max |
What's Next?
- [Data Quality Assessment](data-quality-assessment) — Validate data quality with profiling and rules
- [Missing Data Imputation](missing-data-imputation) — Advanced imputation strategies
- [Statistics Overview](statistics-overview) — Run statistical analysis on your cleaned data
- [Feature Engineering](features-overview) — Create new features for ML
Related Articles
Datasets Guide: Upload, Preview, and Manage Your Data
A comprehensive guide to uploading CSV, Excel, and JSON files, configuring delimiters and encoding, previewing your data, and managing your datasets.
Data Quality Assessment: Profiling, Validation, and Quality Checks
Learn how to profile your data, identify quality issues, set validation rules, and ensure your datasets are reliable before analysis.
Missing Data Imputation: Strategies for Handling Gaps in Your Data
Understand why data goes missing, learn basic and advanced imputation strategies (mean, median, KNN, MICE), and choose the right approach for your dataset.
Statistics Overview: What Are Statistics and How to Use Them
A beginner-friendly introduction to statistics, descriptive vs inferential analysis, the Statistics workspace layout, and running your first analysis.
Was this helpful?