Creating and using an index with a Series or DataFrame