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

AttributeError: 'DataFrame' object has no attribute 'append' #1518

Closed
mikechen66 opened this issue Sep 12, 2023 · 5 comments · May be fixed by #1525
Closed

AttributeError: 'DataFrame' object has no attribute 'append' #1518

mikechen66 opened this issue Sep 12, 2023 · 5 comments · May be fixed by #1525

Comments

@mikechen66
Copy link

mikechen66 commented Sep 12, 2023

For masked_language_modeling.ipynb, there is the error. My system is Python 3.10, TensorFlow 2.13 and pandas 2.03.

It reminds the warning: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.


AttributeError Traceback (most recent call last)
/tmp/ipykernel_97675/3156859266.py in ?()
27
28 # FutureWarning: The frame.append method is deprecated and will be removed from pandas
29 # in a future version. Use pandas.concat instead.
30 # https://stackoverflow.com/questions/75956209/error-dataframe-object-has-no-attribute-append
---> 31 all_data = train_df.append(test_df)

~/miniconda3/envs/tf/lib/python3.10/site-packages/pandas/core/generic.py in ?(self, name)
5985 and name not in self._accessors
5986 and self._info_axis._can_hold_identifiers_and_holds_name(name)
5987 ):
5988 return self[name]
-> 5989 return object.getattribute(self, name)

AttributeError: 'DataFrame' object has no attribute 'append'

@sachinprasadhs sachinprasadhs self-assigned this Sep 12, 2023
@sachinprasadhs
Copy link
Collaborator

Hi,

I was able to run End-to-end Masked Language Modeling with BERT without any error or warning.
Here is the attached Gist for reference. Thanks!

@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Sep 28, 2023
@skon7
Copy link

skon7 commented Sep 29, 2023

I believe the error may be related to your Pandas version. However, in Pandas 2.0, the 'append' method has been deprecated.
You have a few options to resolve this:

  • You can install the Pandas version to one that supports the 'append' method.
  • Or replace 'append' with '_append' if it's suitable for your code.
  • Or use the 'concat' function instead. Please note that the syntax for 'concat' will change, and you'll need to modify your code to use it like this: 'pd.concat( [train_df, test_df], ignore_index=True).'

@qlzh727 @fchollet (i make a PR about this issue #1525 )

@github-actions github-actions bot removed the stale label Sep 30, 2023
@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Oct 15, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment