Open AbdullahAssi opened 10 months ago
hey abdullahassi. is I got the same error and it took me half an hour to resolve, is there is any way we can change the code, so others can't face the issue?
hello MayBPrince,we can solve this problem by creating a branch and then PR to it could be fixed. but i already see 22 PRs open so i see that Repo is not being mentained by the owner.In this situation nothing we can do.
The issue was caused by a compatibility problem with pandas versions greater than 2. : stackoverflow
We can slove this issues by changing
df = df.append(df1,ignore_index=True)
this code with this code
df = pd.concat([df,df1],ignore_index=True)
df.append() is deprecated in latest version of pandas.
new_data = {
'Age': [5, 90, 95],
'EstimatedSalary': [1000, 250000, 350000],
'Purchased': [0, 1, 1]
}
df = pd.concat([df, pd.DataFrame(new_data)], ignore_index=True)
This should work
6200 and name not in self._accessors 6201 and self._info_axis._can_hold_identifiers_and_holds_name(name) 6202 ): 6203 return self[name] -> 6204 return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'append'
having this error. So i got a solution for it. `data_to_append = {'Age': [5, 90, 95], 'EstimatedSalary': [1000, 250000, 350000], 'Purchased': [0, 1, 1]}
df_to_append = pd.DataFrame(data_to_append)
df = pd.concat([df, df_to_append], ignore_index=True)
print(df.describe())`
You can update the file, so others can't face this issue.