test = {'ngrp' : ['Manhattan', 'Brooklyn', 'Queens', 'Staten Island', 'Bronx']}
test = pd.DataFrame(test)
dummy = pd.get_dummies(test['ngrp'], drop_first = True)
This gives me:
Brooklyn Manhattan Queens Staten Island
0 0 1 0 0
1 1 0 0 0
2 0 0 1 0
3 0 0 0 1
4 0 0 0 0
I will get Bronx as my reference level (because that is what gets dropped), how do I change it to specify that Manhattan should be my reference level? My expected output is
Brooklyn Queens Staten Island Bronx
0 0 0 0 0
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1