Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

split list in pd dataframe into rows

df.explode('variable')
Comment

pandas split list in column to rows

df
           A  B   C
0  [0, 1, 2]  1   x
1        foo  1   b

df.explode('A')
     A  B   C
0    0  1   x
0    1  1   x
0    2  1   x
1  foo  1   z
Comment

PREVIOUS NEXT
Code Example
Python :: django group with permission 
Python :: python unresolved import vscode 
Python :: dataframe to pandas 
Python :: split at first occurrence python 
Python :: boids algorithm 
Python :: python advanced programs time module 
Python :: python area of rectangle 
Python :: hash table in python 
Python :: thread syntax in python 
Python :: Math Module ceil() Function in python 
Python :: google calendar Request had insufficient authentication scopes. 
Python :: select columns pandas 
Python :: export some columns to csv pandas 
Python :: download image from url python requests 
Python :: numpy.sign() in Python 
Python :: delete occurrences of an element if it occurs more than n times python 
Python :: download pytz python 
Python :: read specific columns from csv in python pandas 
Python :: rename column in pandas with second row 
Python :: how to get first element of array in python 
Python :: flask flash 
Python :: drop na pandas 
Python :: how to check if number is negative in python 
Python :: python pandas how to get all of the columns names 
Python :: how to update values in tkinter 
Python :: Using Python, getting the name of files in a zip archive 
Python :: django convert object to dict 
Python :: csv to python dictionary 
Python :: get array dimension numpy 
Python :: random.randint 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =