0 OHN m 1 2 3 4 ships_to_country_ids [209, 0, 150, 79, 175] [79, 167, 290, 284, 209, 61, 58, 74, 105, 55, [70, 118, 146,
Posted: Fri Jul 01, 2022 5:34 am
I want to add a new column, which gives the sum of the countryit ships to. So for the first row, the new column should give 5(because [209, 0, 150, 79, 175].
But if i try to print the length of the first row, it gives 22 (by print(len(df['ships_to_country_ids])) ) as it is a string, andnot a list.
0 OHN m 1 2 3 4 ships_to_country_ids [209, 0, 150, 79, 175] [79, 167, 290, 284, 209, 61, 58, 74, 105, 55, [70, 118, 146, 90, 151, 79, 207, 91, 71, 215, [175, 61, 80, 220, 219, 204, 56, 103, 79, 128,. [209, 167, 127, 0, 203, 61, 131] [120, 0] 2... [0, 209] [0, 209] [209, 68, 91, 0] 9993 9994 [155, 151, 99, 243, 278, 144, 127, 180, 207, 9996 9998 9999 1