The CSV file contains: ID,Name 1,AS 2,er 3,rtf 4,addfs
The list contains the name for example (er,rtf) I want to find the ID's corresponding to these names mentioned above How to find the ID's using the Python code.
Thanks in advance
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityThis question should be posted in StackOverflow.
Store your CSV into a Pandas DataFrame and operate on that.
import pandas as pd
df=pd.read_csv('nameofyourcsv.csv')
names=('er','rtf')
for each in names:
print(df.loc[df['Name'] == each, 'ID'].iloc[0])