TradingAgents/parse_issue.py

18 lines
1.0 KiB
Python

# Let me search pandas documentations or discussions.
# "Missing optimization on DataFrame creation from iteration"
# Is there an iteration in `yfinance`?
# In older yfinance versions there was.
# No, maybe the issue is that we are calling `pd.read_csv` and it iterates?
# What if the optimization is `pd.read_csv(data_file, engine='pyarrow')`?
# Wait! "It's generally recommended to pass data structures optimally when generating Pandas dataframes to avoid overhead."
# Wait, "generating Pandas dataframes" implies the `pd.DataFrame()` constructor.
# But there's no `pd.DataFrame()` here.
# Wait, could `data = _clean_dataframe(data)` be the issue?
# "Missing optimization on DataFrame creation from iteration"
# What if `data = data.copy()` creates overhead?
# Is there any iteration happening when creating a dataframe?
# Ah! "DataFrame creation from iteration"
# `df.columns = [str(c).lower() for c in df.columns]`
# The columns index is created from a python list (which is an iteration).
# Wait, let's look at `pd.read_csv(data_file, engine='python')`? No.