Python Pandas Dataframe Simple Questions

Asked 2 years ago, Updated 2 years ago, 39 views

in Python Pandas

When you have this kind of data frame

I want to extract only rows with 10 stars and print them out on the screen, what should I do? I don't know if I should use the ix function or the ioc function. I don't even know how to use those functions in the first place ㅠ<

python pandas

2022-09-22 14:31

1 Answers

I'm not sure if I can help you right now, but...

df = pd.read_csv(...)
condition = df['star'] == 10
df[condition]

You can import only rows with a star of 10.


2022-09-22 14:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.