name|id|nick
Test1|1|@test1
Test2|2|@test2
Test3|3|@test3
import pandas as pd
data = pd.read_csv('list.csv', sep=';')
def get_user_by_id(id, data):
data = data.loc[data['id'] == id, ['nick', 'name']]
name = data['name'][0]
nick = data['nick'][0]
return {'name': name, 'nick': nick}
print(get_user_by_id(1, data))
# Out: {'name': 'Test1', 'nick': '@test1'}