'DataFrame' object has no attribute 'append'
时间: 2023-06-21 11:08:04 浏览: 79
This error usually occurs when you try to use the `append()` method on a pandas DataFrame object.
The `append()` method is not a built-in method for DataFrames, but rather for pandas Series and lists. Instead, you can use the `concat()` method to concatenate two DataFrames vertically. Here is an example:
```
import pandas as pd
# create two sample DataFrames
df1 = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
df2 = pd.DataFrame({'A': [5, 6], 'B': [7, 8]})
# concatenate the two DataFrames
df_concatenated = pd.concat([df1, df2])
print(df_concatenated)
```
This should output:
```
A B
0 1 3
1 2 4
0 5 7
1 6 8
```
You can also specify the axis parameter in the `concat()` method to concatenate horizontally.