This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pandas.concat 实现竖向的拼接 | |
import pandas as pd | |
df1=pd.DataFrame([10,12,13]) | |
df2=pd.DataFrame([22,33,44,55]) | |
df3=pd.DataFrame([90,94]) | |
pd.concat([df1,df2,df3],ignore_index=True) # 纵向组合,注意此时没有设定列名。此时拼接只有一列 | |
# --------concat 多列进行拼接--------- | |
import pandas as pd | |
df1=pd.DataFrame([10,12,13],columns=['1']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pandas.concat 实现竖向的拼接 | |
import pandas as pd | |
df1=pd.DataFrame([10,12,13]) | |
df2=pd.DataFrame([22,33,44,55]) | |
df3=pd.DataFrame([90,94]) | |
pd.concat([df1,df2,df3],ignore_index=True) # 纵向组合,注意此时没有设定列名。此时拼接只有一列 | |
# --------concat 多列进行拼接--------- | |
import pandas as pd | |
df1=pd.DataFrame([10,12,13],columns=['1']) |