All examples for Data Type Validator & Fixer

Sales Data with Currency and Dates

Validates a simple sales dataset with date strings in MM/DD/YYYY format, currency values with dollar signs, and Yes/No boolean text. Demonstrates core type conversions: dates to datetime, currency to numeric, and text booleans to proper bool type.

Input

What you provide to the skill

validate types in my sales data: Date,Product,Amount,Active
01/15/2024,Widget,$1500,Yes
01/16/2024,Gadget,$2300,No

Output

What the skill generates for you

============================================================
INITIAL DATA INSPECTION
============================================================
Current data types:
Date object
Product object
Amount object
Active object
dtype: object
Sample values:
Date Product Amount Active
0 01/15/2024 Widget $1500 Yes
1 01/16/2024 Gadget $2300 No
============================================================
TYPE VALIDATION REPORT
============================================================
1. Converting 'Date' column:
Original type: object
Detected format: MM/DD/YYYY
New type: datetime64[ns]
Successful: 2 | Failed: 0
2. Converting 'Amount' column:
Original type: object (currency strings)
New type: int64
Transformations: removed $, removed commas
Successful: 2 | Failed: 0
3. Converting 'Active' column:
Original type: object
Unique values: ['Yes', 'No']
Mapping: Yes→True, No→False
New type: bool
Successful: 2 | Failed: 0
4. Column 'Product' preserved as string (no conversion needed)
============================================================
FINAL DATA TYPES
============================================================
Date datetime64[ns]
Product object
Amount int64
Active bool
dtype: object
Cleaned data preview:
Date Product Amount Active
0 2024-01-15 Widget 1500 True
1 2024-01-16 Gadget 2300 False
============================================================
SUMMARY STATISTICS
============================================================
Date range: 2024-01-15 to 2024-01-16
Total amount: $3,800.00
Average amount: $1,900.00
Active products: 1
Inactive products: 1
Exported: sales_data_cleaned.csv