To get a plain string from a dataframe query, I use:
df = pd.DataFrame({
"name": ["a", "b", "c"],
"value": [1,2,3],
})
df.query("value == 1")['name'].tolist()[0]
# 'a'
Just wondering if this is the right way to process a pandas.core.series.Series object (i.e. whether there is a more Pythonic way of doing this).