def replace_parts_animal_movement(data_groups, animal_id, time_array,
    replacement_value_x, replacement_value_y):
    """
    Replace subsets (segments) of animal movement based on some indices e.g. time
    This function can be used to remove outliers

    Input:
    1.) First argument is a Python 3 dictionary whose key is 'animal_id'and value is
    Pandas DataFrame for that 'animal_id'
    2.) Second argument is 'animal_id' whose movements have to replaced
    3.) Third argument is an array of time indices whose movements have to replaced
    4.) Fourth argument is the value which will be replaced for all values contained
    in 'time_array' for 'x' attribute
    5.) Fifth argument is the value which will be replaced for all values contained
    in 'time_array' for 'y' attribute

    Returns:
    Modified Python 3 dictionary which was passed as first argument to it

    An example usage-

    data = csv_to_pandas(path)

    data_groups = group_animals(data)

    arr_index = np.array([10, 20, 200, 20000, 40000, 43200])

    replaced_data_groups = replace_parts_animal_movement(data_groups, 811, arr_index, 100, 90)
    """
    data_groups[animal_id].loc[time_array, 'x'] = replacement_value_x
    data_groups[animal_id].loc[time_array, 'y'] = replacement_value_y
    return data_groups
