I know it might be old debate, but out of pandas.drop
and python del
function which is better in terms of performance over large dataset?
I am
tested it on a 10Mb data of stocks, got the following results:
for drop with the following code
t=time.time()
d.drop(labels="2")
print(time.time()-t)
0.003617525100708008
for del with the following code on the same column:
t=time.time()
del d[2]
print(time.time()-t)
time i got was:
0.0045168399810791016
reruns on different datasets and columns didn't make any significant difference