Assuming I have a DataFrame:
import pandas as pd
df = pd.DataFrame([["house", "red"], ["car", "blue"]], columns=["item", "colour"])
What is the idiomatic way to return a single row, or raise an exception if exactly one row is not found, using DataFrame.loc:
match = df.loc[df["colour"] == "red"]]
# I know there is exactly one row in the resulting DataFrame
# TODO: How to make match to return a single row as pd.Series
This would be similar to SQLAlchemy's Query.one()