import csv
from operator import itemgetter

with open('data.csv', 'r') as f:
    data = [line for line in csv.reader(f)]

# new data here

data = sorted(data, key=lambda x:int(x[2])) 

with open('data.csv', 'w', newline='') as f:
    csv.writer(f).writerows(data)
3aec42fb9c1968d6bd185b157ecd30e803fad52f
<mask token>

<mask token>
with open('data.csv', 'r') as f:
    data = [line for line in csv.reader(f)]
<mask token>
with open('data.csv', 'w', newline='') as f:
    csv.writer(f).writerows(data)

<mask token>
with open('data.csv', 'r') as f:
    data = [line for line in csv.reader(f)]
data = sorted(data, key=lambda x: int(x[2]))
with open('data.csv', 'w', newline='') as f:
    csv.writer(f).writerows(data)

import csv
from operator import itemgetter
with open('data.csv', 'r') as f:
    data = [line for line in csv.reader(f)]
data = sorted(data, key=lambda x: int(x[2]))
with open('data.csv', 'w', newline='') as f:
    csv.writer(f).writerows(data)

import csv
from operator import itemgetter

with open('data.csv', 'r') as f:
    data = [line for line in csv.reader(f)]

# new data here

data = sorted(data, key=lambda x:int(x[2])) 

with open('data.csv', 'w', newline='') as f:
    csv.writer(f).writerows(data)