【发布时间】:2019-02-25 17:45:02
【问题描述】:
我有两个数据框,我只是在写一个简单的 pd.concat 来垂直追加数据:
SRC_OF_PAYMENT_80_00_CY=
pd.concat(['src_of_payment_cy','src_of_payment_df'],axis=0, ignore_index=True)
两者都是数据帧类型。所以我不明白错误: TypeError: 无法连接非 NDFrame 对象
Here is the out for df.info() for both:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 10 entries, 0 to 9
Data columns (total 3 columns):
Type_of_cost 10 non-null object
Total_NHE 10 non-null float64
year 10 non-null int64
dtypes: float64(1), int64(1), object(1)
memory usage: 320.0+ bytes
src_of_payment_cy
<class 'pandas.core.frame.DataFrame'>
Int64Index: 18 entries, 9 to 26
Data columns (total 3 columns):
Type_of_cost 18 non-null object
Total_NHE 18 non-null int64
year 18 non-null int64
dtypes: int64(2), object(1)
memory usage: 576.0+ bytes
src_of_payment_df
【问题讨论】:
-
我觉得好傻!谢谢!
标签: python pandas dataframe concat