import numpy as np
from string import letters
media_frame = pd.DataFrame(pd.DataFrame(np.random.choice(list(letters), 
    9500 * 800 * 3).reshape(3, -1)).sum().values.reshape(9500, -1))
u = np.unique(media_frame.values)
from_filenames = pd.Series(u)
to_filenames = from_filenames.str[1:] + from_filenames.str[0]
m = pd.Series(to_filenames.values, from_filenames.values)
Pandas slow on data frame replace