def top_markets_by_property(property_data_frame, number_of_markets, dimension):
    """ A function which returns the top number_of_markets per dataframe
    I: dataframe, the number of markets to return
    O: list of the top markets sorted by number of observations"""

    markets = property_data_frame.groupby([dimension]).count().reset_index()
    markets = markets.copy()
    markets = markets.sort(markets.columns[2],ascending=False)
    top_markets = markets.head(number_of_markets)
    return top_markets[dimension].tolist()