Fixed example and added automatic dataframe index selection
Updated documentation