From the course: pandas Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
String handling - pandas Tutorial
From the course: pandas Essential Training
String handling
- [Instructor] String handling generally have names matching the equivalent scaler built in string methods that are available in Python. These are available under the str attribute. Using the str attribute, you have access to several common string methods, such as contains, startswith, isnumeric and so on. Let's head over to the Jupyter notebook to have a look at a couple of examples. Let's say we want to look up the legendary Flo Jo, who is the fastest woman ever. Her time for the 100 meter sprint from 1988 is still the fastest time recorded today. Now if you're like me, you can't remember her full name. We know her name is Flo Jo, so her first name is Florence. So I go to my data frame, Athlete, and I now use the new string attribute str.contains, and I search for Florence. If I want to see where this is true, so I want to see the rows where this is true, I enter this in square brackets, and I can see a couple of Florences. So, Florence Syers and so on. Clearly the one that we're…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.