Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 805 Bytes

File metadata and controls

29 lines (19 loc) · 805 Bytes

🐍 Python List Comprehension Exercises

Practice exercises demonstrating Python list comprehensions for data transformation, column renaming, and conditional filtering using the Seaborn car_crashes dataset.

Python

Concepts Covered

  • List comprehensions with conditional logic
  • String manipulation (uppercase, prefix addition)
  • Column name transformation patterns
  • Boolean flag creation for filtering

Exercises

  1. Uppercase + Prefix — Rename numeric columns to uppercase with "NUM_" prefix
  2. String Matching — Flag columns that don't contain "no" in their name
  3. Filtered DataFrame — Create a subset using the flag rules above

Usage

pip install seaborn
python List_comprehension.py

License

MIT