...

/

Slicing and Indexing on Strings

Slicing and Indexing on Strings

Learn how to perform slicing and indexing operations on strings with Pandas.

We'll cover the following...

How to use indexes on strings

In this chapter, we’ll use a different dataset called staff.csv. Let’s begin by creating a DataFrame by reading the file.

staff.csv
Press + to interact
import pandas as pd
staff = pd.read_csv("staff.csv")
print(f"\nStaff data frame has the following columns: \n{list(staff.columns)}\n")
print(staff)

Textual data is an important component of data science. Some areas require working with textual data excessively, such as natural language processing (NLP). The Pandas library ...