# selectdataframe from index from list of int top_sim = [21, 24622, 32199, 32570, 17463] top_sim_frame = job_vec.loc[top_simi, : ] # -------------------- You nedd add () because & has higher precedence than ==: df3 = df[(df['count'] == '2') & (df['price'] == '100')] print (df3) id count price 0 1 2 100 If need check multiple values use isin: df4 = df[(df['count'].isin(['2','7'])) & (df['price'].isin(['100', '221']))] print (df4) id count price 0 1 2 100 3 4 7 221 But if check numeric, use: df3 = df[(df['count'] == 2) & (df['price'] == 100)] print (df3) df4 = df[(df['count'].isin([2,7])) & (df['price'].isin([100, 221]))] print (df4)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter