Memisahkan nilai kolom dalam panda
df[['A', 'B']] = df['AB'].str.split('@', 1, expand=True)
#'@' - Split at @
#1 = Axis 1 i.e on column level
AMi
df[['A', 'B']] = df['AB'].str.split('@', 1, expand=True)
#'@' - Split at @
#1 = Axis 1 i.e on column level
# make string version of original column, call it 'col'
df['col'] = df['col1'].astype(str)
# make the new columns using string indexing
df['col1'] = df['col'].str[0:2]
df['col2'] = df['col'].str[2:4]
df['col3'] = df['col'].str[4:6]
# get rid of the extra variable (if you want)
df.drop('col', axis=1, inplace=True)