Question
How to get a single value as a string from pandas dataframe
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 as well. How do I do this?
col_names = ['Host', 'Port']
df = pd.DataFrame(columns=col_names)
df.loc[len(df)] = ['a', 'b']
t = df[df['Host'] == 'a']['Port']
print(t)
EXPECTED OUTPUT: b
46 109078
46