def apply_func(pdf: pd.DataFrame) -> pd.DataFrame:
    pdf_or_pser = pdf.apply(func, axis=axis, args=args, **kwds)
    if isinstance(pdf_or_pser, pd.Series):
        return pdf_or_pser.to_frame()
    else:
        return pdf_or_pser
def apply_func(pdf: pd.DataFrame) -> pd.DataFrame:
    pdf_or_pser = pdf.apply(func, axis=axis, args=args, **kwds)
    if isinstance(pdf_or_pser, pd.Series):
        return pdf_or_pser.to_frame()
    else:
        return pdf_or_pser