0

i have ben trying to run this code is vscode editor to append a dict to a pandas df yet i keep getting a syntax error. Employee.shared_df = Employee.shared_df.append( emp_dict, ignore_index=True) but when i run the same line of code and adjust the append method to "Employee.shared_df._append()" i get the desired result but im told i have made it private. the error is: AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'? i have pandas version 2.0.1

  • Yes, it was removed in pandas 2.0, see duplicate link. In general you should never have to use `append`, it was an inefficient method, thus it's removal. You can use `concat` or `loc` instead, **provided you're not using it in a loop!** – mozway May 10 '23 at 20:36

0 Answers0