Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ZhongHaoAustin opened this issue Aug 1, 2024 · 0 comments

Comments

@ZhongHaoAustin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant