get index as string pandas code example Example: index of a string index dataframe df[df.index.str.startswith('U')]