I've a dataframe df1
id city year
1 LA [2012, 2013, 2014, 2015, 2026]
2 FL []
3 TX [2012, 2013, 2014]
4 NY [2012]
How can I convert the column year that contains list into comma separated string?
Desired result:
id city year
1 LA 2012, 2013, 2014, 2015, 2016
2 FL none
3 TX 2012, 2013, 2014
4 NY 2012
Note: The datatype of column year is string now.