Selection in Pandas is easy! 🎯
13.8K views on YouTube
#coding #python #programming
Selection in Pandas means pulling out specific data from a Series or DataFrame.
import pandas as pd
df = pd.read_csv(“data.csv”, index_col=”Name”)
pokemon = input(“Enter a Pokemon name: “)
try:
print(df.loc[pokemon])
except KeyError:
print(f”{pokemon} not found”)