0

I have a big pandas.DataFrame (~2.5 million rows) with 10 columns. I need to fill column noshow_label, i group data by column event_label and if in column event_action there is a value no_show then i need to paste True else i need paste False. To do that i use this construction:

data['noshow_label'] = data.groupby('event_label')['event_action'].transform(lambda x: 'no_show' in x.values)

When i tried to start this code, it raised an error:

ValueError: Length mismatch: Expected axis has 2328271 elements, new values have 2328273 elements

For note: Column event_action contains values like no_show, show_widget, test_passed. Column 'event_labelcontains labels names like123123-A`, '123123-B' ...

Do you have any ideas to fix it?

Kralon
  • 9
  • 6

1 Answers1

0

It was problem with data, my DataFrame has values like 'NULL' in group column, when i've delete them from my sample, problem has gone.

Kralon
  • 9
  • 6