Open
Description
Issue: DataFrame.append() method no longer exists in newer pandas versions
Description
When using TensorWatch with recent versions of pandas (2.0+), an AttributeError is raised because the DataFrame.append() method no longer exists. This occurs in the text_vis.py
file, specifically in the _append
method of what appears to be a visualization class.
Error Message
AttributeError: 'DataFrame' object has no attribute 'append'
Code Location
The error occurs in the following method:
def _append(self, stream_vis, vals):
# ... (rest of the method)
self.df = self.df.append(self.SeriesClass(val_dict), sort=False, ignore_index=True)
# ...
Suggested Fix
Replace all instances of self.df.append(...)
with pd.concat([self.df, pd.DataFrame([...])], ignore_index=True)
.
For example:
self.df = pd.concat([self.df, pd.DataFrame([val_dict])], ignore_index=True)
Additional Context
- The
append()
method for DataFrames was deprecated in pandas 1.4.0 and removed in pandas 2.0.0. - This change affects all users of TensorWatch who are using pandas 2.0.0 or later.
Environment
- TensorWatch version: 0.9.1
- pandas version: 2.2.2
- Python version: 3.11.9
- Operating System: Window 10
Steps to Reproduce
- Install TensorWatch and pandas 2.0.0 or later
- Run a script that uses TensorWatch's visualization features
- Observe the AttributeError
Thank you for your attention to this issue!
Metadata
Metadata
Assignees
Labels
No labels