<commit_before>"""
Last Observation Carried Forward Algorithm
--------------------------------
"""

import pandas as pd

def locf(data):
    """ For missing values use the last observation carried forward

    PARAMETERS
    ---------<commit_msg>added longer description in docstring<commit_after>"""
Last Observation Carried Forward Algorithm
------------------------------------------
"""

import pandas as pd


def locf(data):
    """ For missing values use the last observation carried forward

    For each set of missing indices, use the value of one column before(same
    row). In the case that the missing value is the first column, we take one
    column ahead instead (same row still).

    PARAMETERS
    ---------
{'fraction_non_alphanumeric': 0.1790633608815427, 'fraction_numerical': 0.0, 'mean_word_length': 2.202643171806167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1310695', 'n_tokens_mistral': 173, 'n_tokens_neox': 162, 'n_words': 82}