shinnytech/tqsdk-python

Deprecation Warning for pd.DataFrame.append in tqsdk/tools/downloader.py Line 192

Opened this issue · 0 comments

Hello Team,

I've noticed that the pd.DataFrame.append method, which has been marked as deprecated, is still being used in the downloader.py script at line 192. To maintain best practices and ensure forward compatibility with future versions of Pandas, I recommend updating the code to use the recommended pd.concat method instead.

Here's the updated code snippet that replaces the deprecated append method with concat, which also handles the index resetting correctly:

df = pd.concat([df, pd.DataFrame({"datetime": [self._end_dt_nano + 1], "factor": [1.0]})], ignore_index=True)

This modification ensures that the DataFrame is updated properly without relying on deprecated features, and it maintains the DataFrame index continuity.

Thank you for considering this update. I believe it will help in keeping the codebase modern and efficient.