Skip to content

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

Open
@yYorky

Description

@yYorky

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions