Horje
python loc id in list Code Example
python loc id in list
In [30]: df = pd.DataFrame({'subscriber_id':[1,2,3,4,5]})
'''   	subscriber_id
	0              1
	1              2
	2              3
	3              4
	4              5 '''

mask = df['subscriber_id'].isin([2,4,5])
''' 0    False
	1     True
	2    False
	3     True
	4     True '''

df.loc[mask]
'''	   subscriber_id
	1              2
	3              4
	4              5 '''




Python

Related
Reading Custom Delimited file in python Code Example Reading Custom Delimited file in python Code Example
huggingface transformers change download path Code Example huggingface transformers change download path Code Example
pandas select rows by condition in list Code Example pandas select rows by condition in list Code Example
views.MainView.as_view(), name='all' Code Example views.MainView.as_view(), name='all' Code Example
python update dict if key not exist Code Example python update dict if key not exist Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7