Fastest
Dictionary
2.10 ms
476 op/s
Speed
Benchmark | Runtime | Operations | VS | Visual |
---|---|---|---|---|
Dictionary | 2.10 ms | 476 op/s | 1× | |
pandas.concat once | 159 ms | 6.28 op/s | 76× | |
pandas.concat | 329 ms | 3.04 op/s | 157× | |
DataFrame.append | 379 ms | 2.64 op/s | 180× |
Memory
Benchmark | Peak Memory | Score | VS | Visual |
---|---|---|---|---|
DataFrame.append | 312 KB | 5.93 | 1× | |
Dictionary | 476 KB | 8.00 | 1.52× | |
pandas.concat once | 696 KB | 5.95 | 2.2× | |
pandas.concat | 896 KB | 5.53 | 2.9× |
Output
Dictionary
city cost number 0 London 32 0 1 Paris 22 1 2 Berlin 64 2 3 London 43 3 4 Paris 79 4 .. ... ... ... 95 Berlin 32 95 96 London 57 96 97 Paris 73 97 98 Berlin 88 98 99 London 12 99 [100 rows x 3 columns]
pandas.concat
city cost number 0 London 62 0 0 Paris 50 1 0 Berlin 63 2 0 London 83 3 0 Paris 88 4 .. ... ... ... 0 Berlin 22 95 0 London 96 96 0 Paris 5 97 0 Berlin 30 98 0 London 21 99 [100 rows x 3 columns]
pandas.concat once
city cost number 0 London 87 0 0 Paris 47 1 0 Berlin 71 2 0 London 81 3 0 Paris 43 4 .. ... ... ... 0 Berlin 21 95 0 London 15 96 0 Paris 85 97 0 Berlin 76 98 0 London 81 99 [100 rows x 3 columns]
DataFrame.append
city cost number 0 London 81 0 0 Paris 29 1 0 Berlin 96 2 0 London 97 3 0 Paris 99 4 .. ... ... ... 0 Berlin 58 95 0 London 7 96 0 Paris 27 97 0 Berlin 87 98 0 London 17 99 [100 rows x 3 columns]