Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13981

How to split values in column and make a new dataframe in pandas [duplicate]

$
0
0

I have a pandas dataframe in python

ColA   ColBA      hg_gh | fg_tr | yu_jhdA      hg_dh | fg_fr B      hg_th | fg_er | yu_jkdC      hg_zh | fg_qr

Is there a way to split it and make a new column like belowBasically split all values across different categories in ColA

ColA  ColB    A     hg_ghA     fg_trA     yu_jhdA     hg_dhA     fg_frB     hg_thB     fg_erB     yu_jkdC     hg_zhC     fg_qr

There is an option to explode it, but unfortunately, lower versions of pandas does not support explode.


Viewing all articles
Browse latest Browse all 13981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>