to_index supports Series and DataFrame