A #Python #Pandas column contains comma-separated values. How can you get the first of those?
First, break each string into a list:
df['x'].str.split(',')
Then use .str[0] to grab the first element from the resulting list:
df['x'].str.split(',').str[0]