0

Let's assume that I have a pandas dataset and its column A contains n dimensional vectors. I would like to split this column into multiple columns. Basically, my dataset looks like :

A              B       C  
[1,0,2,3,5]   ...     ...
[4,5,3,2,1]   ...     ...
.........................

And I want to have :

A0 A1 A2 A3 A4 B    C
1  0  2  3  5  ...  ...
4  5  3  2  1  ...  ...
.......................

I can solve this problem by using apply function and for loops, I think. But, I imagine that there exists a better (faster, easier to read, ...) way to do so.

Edit: My post gets marked as duplicate. But the given answers have a solution which leads to more rows. I want more columns as shown above. Thanks,

kakarotto
  • 180
  • 1
  • 11

0 Answers0