Sl。编号,名称,地址
1.,Stuart,华尔街
2.,Charlie,Broadway
3.Oliver,Hollywood Boulevard
4.,Harry,Las Vegas Boulevard
5.,Kyle,Bourbon Street
o / p将像:
print(Stuart) >>> Wall Street
答案 0 :(得分:0)
将csv导入pandas dataframe
并使用loc
import pandas as pd
df = pd.read_csv('/Users/prince/Downloads/test2.csv', sep=',')
df = df.set_index('Name')
print(df.loc['Stuart']['Address'])
给出以下输出
Wall Street