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

DataFrame.append() method no longer exists in newer pandas versions #87

Open
yYorky opened this issue Sep 24, 2024 · 0 comments
Open

DataFrame.append() method no longer exists in newer pandas versions #87

yYorky opened this issue Sep 24, 2024 · 0 comments

Comments

@yYorky
Copy link

yYorky commented Sep 24, 2024

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

  1. Install TensorWatch and pandas 2.0.0 or later
  2. Run a script that uses TensorWatch's visualization features
  3. Observe the AttributeError

Thank you for your attention to this issue!

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