I am trying to read some specific ids from a large file 5GB.
For Ex below is the sample file having columns ['ID','Fruit Name']
ID Fruit Name
'234' Orange
'789' Grapes
'567' Fig
'412' Carrot
'589' Apple
'609' Pomegranate
'778' Mango
'889' Date
'999' Banana
'101' Strawberry
Trying to read some specific IDs from above file by below code. It takes a first whole file into memory then perform extraction data of specific ID. Could this process be done in another way such that without loading whole file only specific ID data can be extracted.
df=pd.read_csv("fruit.csv")
df=df[df.isin(['101','567']).any(1).values]
Please suggest idea of doing above use case with pandas or context manager in python.