Skip to content

Instantly share code, notes, and snippets.

@RaulMedeiros
Created November 22, 2019 12:51
Show Gist options
  • Save RaulMedeiros/4c393311af17bb17a1b495fa4dbaf453 to your computer and use it in GitHub Desktop.
Save RaulMedeiros/4c393311af17bb17a1b495fa4dbaf453 to your computer and use it in GitHub Desktop.
import itertools
dict_ = [{'a': [[10.0], ['10', 20], [30.0], ['10', 20, 30.0]],
'b': [[10.0], ['10', 20], [30.0], ['10', 20, 30.0]] }]*10
df = pd.DataFrame(dict_)
function = lambda x: list(itertools.chain.from_iterable(x['a']))
df['a'] = df.apply(function, axis=1)
df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment