I have a file in the csv extension, which stores data about a person (first name, last name, phone number, date of birth). I need to change a certain position in it (for example, a name). I use pandas for this:
file = pd.read_csv('phonebook.csv', sep=',') name = input('Old name: ') surname = input('Surname: ') n_name = input('New name: ') reader = csv.reader(file_obj) for row in file: if name == row[0] and surname == row[1]: file.ix[0, row] = n_name file.to_csv('phonebook.csv', index=False) However, after calling the entire file, the changes are not saved. Tell me, please, how to make the changes saved?