def single_row_or_col_df_to_series(desired_type: Type[T], single_rowcol_df: pd.DataFrame, logger: Logger, **kwargs)-> pd.Series:
if single_rowcol_df.shape[<NUM_LIT:0>] == <NUM_LIT:1>:<EOL><INDENT>return single_rowcol_df.transpose()[<NUM_LIT:0>]<EOL><DEDENT>elif single_rowcol_df.shape[<NUM_LIT:1>] == <NUM_LIT:2> and isinstance(single_rowcol_df.index, pd.RangeIndex):<EOL><INDENT>d = single_rowcol_df.set_index(single_rowcol_df.columns[<NUM_LIT:0>])<EOL>return d[d.columns[<NUM_LIT:0>]]<EOL><DEDENT>elif single_rowcol_df.shape[<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>d = single_rowcol_df<EOL>return d[d.columns[<NUM_LIT:0>]]<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' + str(single_rowcol_df.shape) + '<STR_LIT>')<EOL><DEDENT>
Helper method to convert a dataframe with one row or one or two columns into a Series

:param desired_type:
:param single_col_df:
:param logger:
:param kwargs:
:return: