From 2d3fffedf4d7f6205f2e0c5ac737ee06a70bff2b Mon Sep 17 00:00:00 2001 From: Kappadeus Date: Sat, 9 Jun 2018 22:23:22 +0100 Subject: [PATCH] fixed not sorting in extract_coinmarketcap --- cryptory/cryptory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cryptory/cryptory.py b/cryptory/cryptory.py index 3d5760b..5507f59 100644 --- a/cryptory/cryptory.py +++ b/cryptory/cryptory.py @@ -29,7 +29,7 @@ def __init__(self, from_date, to_date=None, ascending=False, to_date : the end date (as string) for the returned data; required format is %Y-%m-%d (e.g. "2017-06-21") Optional. If unspecified, it will default to the current day - to_date : binary. Determines whether the returned dataframes are + ascending : binary. Determines whether the returned dataframes are ordered by date in ascending or descending order (defaults to False i.e. most recent first) fillgaps : binary. When data does not exist (e.g. weekends for stocks) @@ -138,6 +138,8 @@ def extract_coinmarketcap(self, coin, coin_col=False): output.columns = [col.lower() for col in output.columns] if coin_col: output['coin'] = coin + + output = output.sort_values(by='date', ascending=self.ascending).reset_index(drop=True) return output def extract_bitinfocharts(self, coin, metric="price", coin_col=False, metric_col=False):