diff --git a/ohlcv/ohlcv.py b/ohlcv/ohlcv.py index 52e9d32..1835622 100644 --- a/ohlcv/ohlcv.py +++ b/ohlcv/ohlcv.py @@ -180,9 +180,8 @@ def monitoring(): if verbose: print(Fore.CYAN, f"Aggregating {len(requests)} dataframe for a total of {limit} candles. This might take " f"some time.", Fore.RESET) - df = pd.concat([responses[i][0] for i in range(len(requests))], ignore_index=True) + df = pd.concat([responses[i][0] for i in range(len(requests))], ignore_index=True).iloc[:-1].iloc[:limit] df = df.drop_duplicates(subset=['timestamp']) - df = df.iloc[:limit] df = df.reset_index(drop=True) return df @@ -205,7 +204,10 @@ def update(self, dataframe: pd.DataFrame, market: str, timeframe: str, verbose: new_data = self.download(market, timeframe, since, limit, verbose, workers) except NotEnoughDataException: return dataframe - return pd.concat([dataframe, new_data], ignore_index=True) + df = pd.concat([dataframe, new_data], ignore_index=True) + df = df.drop_duplicates(subset=['timestamp']) + df = df.reset_index(drop=True) + return df def load(self, market: str, timeframe: str, since: str, limit: (int, str), update: bool = False, verbose: bool = True, workers: int = 100): diff --git a/setup.py b/setup.py index a62ada7..86c472a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ long_description = (this_directory / "README.md").read_text() setup(name='ohlcv-plus', - version='2.0.1', + version='2.0.2', description='Crypto OHLCV data downloader.', long_description=long_description, long_description_content_type='text/markdown',