0

Have this section of code

repTab = pd.DataFrame([[reply.author.name, gottem, reply.created_utc]])
repHolder = repHolder.append(repTab)

getting this error

return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'append'

Tried to fix it to support the updates since code was last used with this:

repTab = pd.concat((reply.author.name, gottem, reply.created_utc))
repHolder = repHolder.append(repTab)

but that didn't work either and just gave different errors

Not sure how to rewrite it for the current version of pandas

Fanny Pack
  • 13
  • 1
  • Read the docs about `concat`: https://pandas.pydata.org/docs/reference/api/pandas.concat.html?highlight=concat#pandas.concat – Michael Butscher Aug 12 '23 at 02:21
  • 1
    "but that didn't work either and just gave different errors" - no, it gave you one error, because you tried one thing, and once there is an error everything stops. Did you try reading that error? Did you try reading the documentation for `pd.concat`, in order to understand what should be passed to it? Do you see how the data you pass to `pd.concat` in this attempt, differs from `repTab`? "Not sure how to rewrite it for the current version of pandas" - why do you expect that this has to do with the Pandas version? Did you test the same code with the older version? – Karl Knechtel Aug 12 '23 at 05:59

1 Answers1

0

Concat like this:

repTab = pd.DataFrame([[reply.author.name, gottem, reply.created_utc]])    
repHolder = pd.concat([repholder, repTab])