File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,13 @@ def map(self, zone_ids):
123123 if self .offset_series is not None :
124124 assert (self .offset_int is None )
125125 assert isinstance (self .offset_series , pd .Series )
126- # FIXME - faster to use series.map if zone_ids is a series?
127- offsets = quick_loc_series (zone_ids , self .offset_series ).fillna (NOT_IN_SKIM_ZONE_ID ).astype (int )
126+
127+ # FIXME - turns out it is faster to use series.map if zone_ids is a series
128+ # offsets = quick_loc_series(zone_ids, self.offset_series).fillna(NOT_IN_SKIM_ZONE_ID).astype(int)
129+
130+ if isinstance (zone_ids , np .ndarray ):
131+ zone_ids = pd .Series (zone_ids )
132+ offsets = zone_ids .map (self .offset_series , na_action = 'ignore' ).fillna (NOT_IN_SKIM_ZONE_ID ).astype (int )
128133
129134 elif self .offset_int :
130135 assert (self .offset_series is None )
You can’t perform that action at this time.
0 commit comments