How to get a single value as a string from pandas data frame

前端 未结 3 1339
闹比i
闹比i 2021-02-20 04:05

I am querying a single value from my data frame which seems to be \'dtype: object\'. I simply want to print the value as it is with out printing the index or other information a

3条回答
  •  失恋的感觉
    2021-02-20 04:34

    As mentioned in my comment, using [1] should work afterwards, to pull the variable you're looking for.

    t = df[df['Host'] == 'a']['Port'][1]
    

提交回复
热议问题