Code
import pandas as pd
from io import StringIO
# Create a simple CSV string
= """
csv_data name,age,city
Alice,28,New York
Bob,35,San Francisco
Charlie,42,Chicago
"""
# Read the CSV data
= pd.read_csv(StringIO(csv_data))
df print(df)
name age city
0 Alice 28 New York
1 Bob 35 San Francisco
2 Charlie 42 Chicago