0

I have situation in which the following data frame:

case_id      case_lang     case_text
1            en            ABC
2            fr            BCDS
3            ru            TTTT
4            hi            WEWE

df['case_lang'].value_counts() will give en,fr,eu,hi

should get split like this:

    case_id      case_lang_en    case_lang_fr    case_lang_ru      case_lang_hi 
    1             ABC
    2                            BCDS
    3                                            TTTT
    4                                                               WEWE

and this should be dynamic in nature. For example, if there are any new rows are added that do not fall under the previous category of values, for example de is added then it should automatically be split up and shown as new columns for de as well like case_lang_de

Django0602
  • 797
  • 7
  • 26

0 Answers0