pandas loc for list
df.loc[df['channel'].isin(['sale','fullprice'])]
pandas loc for list
df.loc[df['channel'].isin(['sale','fullprice'])]
df.loc
# Getting values on a DataFrame with an index that has interger "labels"
df = pd.DataFrame([[1, 2], [4, 5], [7, 8]],
... index=[7, 8, 9], columns=['max_speed', 'shield'])
>>> df
max_speed shield
7 1 2
8 4 5
9 7 8
# the integer is interpreted as "label" but NOT an "interger position along the index"
>>> df.loc[7:9]
max_speed shield
7 1 2
8 4 5
9 7 8
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us