You don't even need pandas for that. Here is a code. Not tested as you did not provide data.
For the future, it would be awesome if you provided any code you tried to write as well as data that would make helping you easier.
names = []
with open("filename.csv", 'r') as f:
for line in f.readlines():
split_names = line.split(' ')
names.append(split_names[0], ' '.join(split_names[1:]))
PS: The code assumes there is no header in the file. So you will have to either remove the header or skip the line in the code.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments