# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/Tutorials/04_manipulate.ipynb.

# %% auto 0
__all__ = ['setRowAsHeader']

# %% ../nbs/Tutorials/04_manipulate.ipynb 2
import pandas as pd

def setRowAsHeader(df:pd.DataFrame=None, row_num:int=None) -> pd.DataFrame:
    """
    Set the specified row as column names for the given DataFrame
    """

    if row_num is None or df is None:
        raise ValueError("df and row_num must be an provided")
    
    new_header = df.iloc[row_num]  
    df = df[row_num + 1:]  
    df.columns = new_header  

    # set header as strings
    df.columns = df.columns.astype(str)    
    
    return df
