dataframe without append how to achieve it
To create a new dataframe without appending data to an existing dataframe, you can simply create a new dataframe and assign data to it. Here's an example:
import pandas as pd
# create a new dataframe
df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
print(df)
# create another dataframe
df2 = pd.DataFrame({'A': [7, 8, 9], 'B': [10, 11, 12]})
print(df2)
Output:
A B
0 1 4
1 2 5
2 3 6
A B
0 7 10
1 8 11
2 9 12
In this example, we create a new dataframe df with columns A and B and assign some data to it. We then create another dataframe df2 with the same columns and assign some different data to it. There is no appending involved, we simply create two separate dataframes
原文地址: https://www.cveoy.top/t/topic/fd2R 著作权归作者所有。请勿转载和采集!