<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def df_first_row_to_dict(df):
 """First DataFrame row to list of dict Args: df (pandas.DataFrame):
 A DataFrame with at least one row Returns: A list of dict that looks like: [{'C1': 'x'}, {'C2': 'y'}, {'C3': 'z'}] from a DataFrame that looks like: C1 C2 C3 1 x y z Else if `df` is `None`, returns `None` """

        if df is not None:
            return [dict(r) for i, r in df.head(1).iterrows()][0]