How do i create a pandas column, where the lists inside my list become cells on their own? E.g.: I have the following nested list:
nested = [['1', '2', '3'],['2', '3', '1'],['3', '4'],['1']]
This list contains around 300 separate lists with strings of different length (min 1 max 5). Now i want to create a pandas dataframe column, where each of these lists in a single cell, not where each string is in a different cell. I tried it this way
df['new column'] = df[["col1", "col2"]].apply(lambda x: ''.join(x), axis=1)
but it gives me an error messsage, because there are some None values, because the lists initially had different lengths.
pd.DataFrame([nested]).Tor more likelydf['new_column'] = pd.Series(nested)?