I am pretty new to Jupyter and have imported a data set. That worked fine. Then I wanted to use the loc
function to get just one specific value in a specific column. However the loc
function simply doesn't work on my Jupyter notebook. I have restarted the whole system - still doesn't work.
Here is an image of the imported data and the DataFrame:
Then I tried the loc function, however - nothing changes in the DataFrame. It actually should filter in the column "Type 1" to just contain values "Fire":
Can someone please help me to get this working? What am I doing wrong?
You made a simple mistake. df prints the whole dataframe just remove the last line
!pip install pandas
import pandas as pd
df = pd.read_csv("/content/pokemon.csv")
df.head(10)
df.loc[df["Type 1"] == "Fire"]