Mar-07-2019, 12:57 AM
Look at the following example
import pandas as pd df = pd.DataFrame({'streets':['street1'] * 3+['street2'] * 4, 'unit': range(7)}).set_index('streets')I can select all streets by name, e.g. (street1):
df.ix[['street1']]
Output: unit
streets
street1 0
street1 1
street1 2
Your solution is good as well.