mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Avoid pandas' SettingWithCopyWarning (#5105)
This commit is contained in:
committed by
GitHub
parent
f0e0217083
commit
5f8657bbfa
@@ -300,6 +300,9 @@ def print_rich_table(
|
||||
current_user.preferences.USE_INTERACTIVE_DF and plots_backend().isatty
|
||||
)
|
||||
|
||||
# Make a copy of the dataframe to avoid SettingWithCopyWarning
|
||||
df = df.copy()
|
||||
|
||||
show_index = not isinstance(df.index, pd.RangeIndex) and show_index
|
||||
# convert non-str that are not timestamp or int into str
|
||||
# eg) praw.models.reddit.subreddit.Subreddit
|
||||
|
||||
Reference in New Issue
Block a user