MAINT: Use sort_values() instead of sort().

pd.DataFrame.sort() is deprecated.
This commit is contained in:
Scott Sanderson
2016-07-19 09:41:56 -04:00
parent 874d2b51f1
commit b5fd0cdbfa
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ class EventIndexerTestCase(ZiplineTestCase):
@classmethod
def init_class_fixtures(cls):
super(EventIndexerTestCase, cls).init_class_fixtures()
cls.events = make_events(add_nulls=False).sort('event_date')
cls.events = make_events(add_nulls=False).sort_values('event_date')
cls.events.reset_index(inplace=True)
def test_previous_event_indexer(self):
+4 -2
View File
@@ -109,10 +109,12 @@ class EventsLoader(PipelineLoader):
events = events[events[EVENT_DATE_FIELD_NAME].notnull()]
# We always work with entries from ``events`` directly as numpy arrays,
# so we coerce from a frame here.
# so we coerce from a frame to a dict of arrays here.
self.events = {
name: np.asarray(series)
for name, series in events.sort(EVENT_DATE_FIELD_NAME).iteritems()
for name, series in (
events.sort_values(EVENT_DATE_FIELD_NAME).iteritems()
)
}
# Columns to load with self.load_next_events.