-1
I researched a solution but I can’t locate facing a data frame, just input lines for example.
I HAVE A DATAFRAME WITH THE FOLLOWING FIELDS AND LINES:
data = {'País': ['Bélgica', 'Índia', 'Brasil'],
'Capital': ['Bruxelas', 'Nova Delhi', 'Brasília'],
'População': ['123/A465', '456/A789', '987/A654']}
df_DIV = pd.DataFrame(data, columns=['País','Capital','População'])
CURRENT EXIT:
I need to divide the Population column into two where the parameter would be "/" and there is no pattern in the amount of character before ' ' so I can divide with df['New Field'] = df['Population']. str[:5] for example, so I would need it to stay that way:
BUT THAT’S JUST AN EXAMPLE OF WHAT I NEED TO DO IN A 300,000-LINE DF.
Thanks Cleverson, I also found a split method commented below.
– Daymon Rebac