pandas.Series.str - Vectorized string function
Shekhar Pandey
Tech Lead | Digital Transformation, Robotics Process Automation, Machine Learning, Artificial Intelligence, AIOps, DevOps, Cloud Computing
Pandas Series and Index are equipped with a set of string processing methods that make it easy to operate on each element of the array. We will deal with couple of examples.
Lets say, we create a Series of STD codes and city names separated by '#'
import pandas as pd stdcodes = pd.Series(['11#delhi', '22#mumbai', '33#kolkatta', '44#chennai', '40#hyderabad']) print(stdcodes)
Hack#1 : Lets split the elements of series and extract std and city
Hack#2: Another Quick hack to split elements of a series & create dataframe in one go
Hack#3: in a Profit field, amounts are having dollar , commas, these need to be replaced so arithmetic operations can be performed
Hack#4: Super cool hack to extract birthdays of super heroes
?
Telco Mobile Core (3G/4G/5GC&IMS) Specialist | Cloud & Virtualization Expert| Data Analyst | MVNO expert
1 年Good, many thanks for this. ??