<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def index_encoding(sequences, letter_to_index_dict):
 """ Encode a sequence of same-length strings to a matrix of integers of the same shape. The map from characters to integers is given by `letter_to_index_dict`. Given a sequence of `n` strings all of length `k`, return a `k * n` array where the (`i`, `j`)th element is `letter_to_index_dict[sequence[i][j]]`. Parameters sequences : list of length n of strings of length k letter_to_index_dict : dict : string -> int Returns ------- numpy.array of integers with shape (`k`, `n`) """

    df = pandas.DataFrame(iter(s) for s in sequences)
    result = df.replace(letter_to_index_dict)
    return result.values