# importing pandas as pd
import pandas as pd
# creating dictionary of lists
dict = {'student':["Luis", "Hannah", "Elizabeth", "Clara"],
'subject': ["math", "math", "economics", "math"],
'score':[90, 60, 80, 98]}
df = pd.DataFrame(dict, index = [0, 1, 2, 3])
mask = df.index == 0
print(df[mask])
Comments
Leave a comment