Stage 1 · Lesson 9 of 9
Working with text in Python
Text work starts with plain Python strings. Learn slicing, split and join, , and reading files with an explicit encoding="utf-8". Python strings are , so Urdu, Arabic and emojis are all just characters, but the same letter can be stored in more than one way, which unicodedata.normalize fixes.
Regular expressions, the re module, find patterns such as phone numbers, URLs and repeated letters. In pandas the .str accessor applies these to a whole column at once. Practise on real messy text: product reviews, tweets or support messages in more than one language.
Common trapcleaning too hard, such as lowercasing everything and stripping punctuation and emojis, before you know whether they carry meaning for your task.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking Python Fundamentals
Design Gurus · Beginner · $50
Core Python with an exercise after nearly every lesson, before the data libraries
- BookFreePython for Data Analysis, 3rd Edition
Wes McKinney · Beginner
Free online: NumPy, pandas and plotting from pandas' own creator