Get The First & Last N Characters
Python
Data Preprocessing
1| # get the first two characters of each string in a DataFrame column 2| df['start'] = df['Name'].apply(lambda x: x[0:2]) 3| 4| # get the last two characters of each string in a DataFrame column 5| df['end'] = df['Name'].apply(lambda x: x[-2:len(x)])
4
4
3
3
2
How to Remove Punctuation From Text with Python
Python
Data Preprocessing
Nlp | String | Punctuation
2
2
How to Create Different Aggregations Using GroupBy, Agg & Dictionaries
Python
Data Preprocessing
2
2
2