acoustic_data_science/processing/combine_csvs.py
def combine_csvs(month):
    """
    Takes path to month folder which should contain all CSVs to be combined as
    top level files e.g. ../data/raw/reorganised_tols/
    Returns dataframe with CSVs contatenated and filenames column.
    """
    logging.info("Getting list of csv files in month directory.")
    files = glob.iglob(os.path.join(month, "*.csv"))
    logging.info(
        "Making DataFrame generator for each CSV. Name of file saved in"
        " filename column."
    )
    df_from_each_file = (
        pd.read_csv(f).assign(filename=os.path.basename(f).split("/")[-1])
        for f in files
    )
    # Time ordering of rows preserved within each DF but DFs are in wrong order at this point.
    # Save in interim path as YYYY_MM.feather.
    logging.info("Concatenate each DataFrame.")
    return pd.concat(df_from_each_file, ignore_index=True)
    # .to_feather(os.path.join(config.interim_data_path,month.split('/')[-1]+'.feather'))

    Takes path to month folder which should contain all CSVs to be combined as
    top level files e.g. ../data/raw/reorganised_tols/
    Returns dataframe with CSVs contatenated and filenames column.
    
Takes path to month folder which should contain all CSVs to be combined as
top level files e.g. ../data/raw/reorganised_tols
Returns dataframe with CSVs contatenated and filenames column.
Takes path to month folder which should contain all CSVs to be combined as top level files e . g . .. / data / raw / reorganised_tols Returns dataframe with CSVs contatenated and filenames column .
def combine_csvs(month):
    logging.info("Getting list of csv files in month directory.")
    files = glob.iglob(os.path.join(month, "*.csv"))
    logging.info(
        "Making DataFrame generator for each CSV. Name of file saved in"
        " filename column."
    )
    df_from_each_file = (
        pd.read_csv(f).assign(filename=os.path.basename(f).split("/")[-1])
        for f in files
    )
    logging.info("Concatenate each DataFrame.")
    return pd.concat(df_from_each_file, ignore_index=True)
def combine_csvs ( month ) : logging . info ( "Getting list of csv files in month directory." ) files = glob . iglob ( os . path . join ( month , "*.csv" ) ) logging . info ( "Making DataFrame generator for each CSV. Name of file saved in" " filename column." ) df_from_each_file = ( pd . read_csv ( f ) . assign ( filename = os . path . basename ( f ) . split ( "/" ) [ - 1 ] ) for f in files ) logging . info ( "Concatenate each DataFrame." ) return pd . concat ( df_from_each_file , ignore_index = True )
Takes path to month folder which should contain all CSVs to be combined as
top level files e.g.
Takes path to month folder which should contain all CSVs to be combined as top level files e . g .
"""
    Takes path to month folder which should contain all CSVs to be combined as
    top level files e.g. ../data/raw/reorganised_tols/
    Returns dataframe with CSVs contatenated and filenames column.
    """ # Time ordering of rows preserved within each DF but DFs are in wrong order at this point. # Save in interim path as YYYY_MM.feather. # .to_feather(os.path.join(config.interim_data_path,month.split('/')[-1]+'.feather'))
month