Skip to main content
deleted 2 characters in body
Source Link
smci
  • 33.6k
  • 21
  • 116
  • 149

Not sure how you were calling concat()concat() but it should work as long as both objects are of the same type. Maybe the issue is that you need to cast your second vector to a dataframe? Using the df that you defined the following works for me.:

>>>df2df2 = pd.DataFrame([[2,3,4]], columns=['A','B','C'])
>>>pdpd.concat([df2, df])

Not sure how you were calling concat() but it should work as long as both objects are of the same type. Maybe the issue is that you need to cast your second vector to a dataframe? Using the df that you defined the following works for me.

>>>df2 = pd.DataFrame([[2,3,4]],columns=['A','B','C'])
>>>pd.concat([df2,df])

Not sure how you were calling concat() but it should work as long as both objects are of the same type. Maybe the issue is that you need to cast your second vector to a dataframe? Using the df that you defined the following works for me:

df2 = pd.DataFrame([[2,3,4]], columns=['A','B','C'])
pd.concat([df2, df])
Source Link
mgilbert
  • 3.6k
  • 4
  • 25
  • 39

Not sure how you were calling concat() but it should work as long as both objects are of the same type. Maybe the issue is that you need to cast your second vector to a dataframe? Using the df that you defined the following works for me.

>>>df2 = pd.DataFrame([[2,3,4]],columns=['A','B','C'])
>>>pd.concat([df2,df])