AssertionError: Number of manager items must equal union of block items manager items: 2820, # tot_items: 2821
I use the following code to combine description columns into a text column. This normally works, but I recently added some columns to lab_tickets_df
. Now it gives the error above
cols = [c for c in lab_tickets_df.columns if "description" in c.lower()]
lab_tickets_df["Text"] = lab_tickets_df[cols].apply(lambda x:\ '
'.join(x.dropna().astype(str)), axis=1)
The funny thing is, that now after adding some columns, I get the exact same error when I, for example, do:
lab_tickets_df.drop(columns = ["0"])
and many other operations.
Why do I get this assertionError for so many operations?