Performance tips#

using DataFrames
using BenchmarkTools
using CategoricalArrays
using PooledArrays
using Random

Access by column number is faster than by name#

x = DataFrame(rand(5, 1000), :auto)
@btime $x[!, 500];
@btime $x.x500;
  3.396 ns (0 allocations: 0 bytes)
  10.811 ns (0 allocations: 0 bytes)

When working with data DataFrame use barrier functions or type annotation#

function f_bad() ## this function will be slow
    Random.seed!(1)
    x = DataFrame(rand(1000000, 2), :auto)
    y, z = x[!, 1], x[!, 2]
    p = 0.0
    for i in 1:nrow(x)
        p += y[i] * z[i]
    end
    p
end

@btime f_bad();
# if you run @code_warntype f_bad() then you notice
# that Julia does not know column types of `DataFrame`
  94.707 ms (5999012 allocations: 122.06 MiB)

solution 1 is to use barrier function (it should be possible to use it in almost any code)

function f_inner(y, z)
    p = 0.0
    for i in 1:length(y)
        p += y[i] * z[i]
    end
    p
end
f_inner (generic function with 1 method)

extract the work to an inner function

function f_barrier()
    Random.seed!(1)
    x = DataFrame(rand(1000000, 2), :auto)
    f_inner(x[!, 1], x[!, 2])
end
f_barrier (generic function with 1 method)

or use inbuilt function if possible

using LinearAlgebra
function f_inbuilt()
    Random.seed!(1)
    x = DataFrame(rand(1000000, 2), :auto)
    dot(x[!, 1], x[!, 2])
end
f_inbuilt (generic function with 1 method)
@btime f_barrier();
@btime f_inbuilt();
  4.139 ms (34 allocations: 30.52 MiB)
  3.484 ms (34 allocations: 30.52 MiB)

solution 2 is to provide the types of extracted columns. It is simpler but there are cases in which you will not know these types. This example assumes that you have DataFrames master at least from August 31, 2018

function f_typed()
    Random.seed!(1)
    x = DataFrame(rand(1000000, 2), :auto)
    y::Vector{Float64}, z::Vector{Float64} = x[!, 1], x[!, 2]
    p = 0.0
    for i in 1:nrow(x)
        p += y[i] * z[i]
    end
    p
end

@btime f_typed();
  4.141 ms (34 allocations: 30.52 MiB)

In general for tall and narrow tables it is often useful to use Tables.rowtable, Tables.columntable or Tables.namedtupleiterator for intermediate processing of data in a type-stable way.

Consider using delayed DataFrame creation technique#

also notice the difference in performance between copying vs non-copying data frame creation

function f1()
    x = DataFrame([Vector{Float64}(undef, 10^4) for i in 1:100], :auto, copycols=false) ## we work with a DataFrame directly
    for c in 1:ncol(x)
        d = x[!, c]
        for r in 1:nrow(x)
            d[r] = rand()
        end
    end
    x
end

function f1a()
    x = DataFrame([Vector{Float64}(undef, 10^4) for i in 1:100], :auto) ## we work with a DataFrame directly
    for c in 1:ncol(x)
        d = x[!, c]
        for r in 1:nrow(x)
            d[r] = rand()
        end
    end
    x
end

function f2()
    x = Vector{Any}(undef, 100)
    for c in 1:length(x)
        d = Vector{Float64}(undef, 10^4)
        for r in 1:length(d)
            d[r] = rand()
        end
        x[c] = d
    end
    DataFrame(x, :auto, copycols=false) ## we delay creation of DataFrame after we have our job done
end

function f2a()
    x = Vector{Any}(undef, 100)
    for c in 1:length(x)
        d = Vector{Float64}(undef, 10^4)
        for r in 1:length(d)
            d[r] = rand()
        end
        x[c] = d
    end
    DataFrame(x, :auto) ## we delay creation of DataFrame after we have our job done
end

@btime f1();
@btime f1a();
@btime f2();
@btime f2a();
  27.076 ms (1949524 allocations: 37.40 MiB)
  27.883 ms (1949724 allocations: 45.03 MiB)
  1.175 ms (524 allocations: 7.66 MiB)
  1.595 ms (724 allocations: 15.29 MiB)

You can add rows to a DataFrame in place and it is fast#

x = DataFrame(rand(10^6, 5), :auto)
y = DataFrame(transpose(1.0:5.0), :auto)
z = [1.0:5.0;]

@btime vcat($x, $y); ## creates a new DataFrame - slow
@btime append!($x, $y); ## in place - fast

x = DataFrame(rand(10^6, 5), :auto) ## reset to the same starting point
@btime push!($x, $z); ## add a single row in place - fast
  2.820 ms (211 allocations: 38.16 MiB)
  1.371 μs (30 allocations: 1.80 KiB)
  477.405 ns (16 allocations: 256 bytes)

Allowing missing as well as categorical slows down computations#

using StatsBase

function test(data) ## uses countmap function to test performance
    println(eltype(data))
    x = rand(data, 10^6)
    y = categorical(x)
    println(" raw:")
    @btime countmap($x)
    println(" categorical:")
    @btime countmap($y)
    nothing
end

test(1:10)
test([randstring() for i in 1:10])
test(allowmissing(1:10))
test(allowmissing([randstring() for i in 1:10]))
Int64
 raw:
  1.608 ms (7 allocations: 7.63 MiB)
 categorical:
  9.910 ms (4 allocations: 688 bytes)
String
 raw:
  19.638 ms (4 allocations: 528 bytes)
 categorical:
  24.002 ms (4 allocations: 688 bytes)
Union{
Missing, Int64}
 raw:
  7.036 ms (4 allocations: 560 bytes)
 categorical:
  16.008 ms (1000004 allocations: 30.52 MiB)
Union{Missing, String}
 raw:
  19.917 ms (4 allocations: 528 bytes)
 categorical:
  31.779 ms (1000004 allocations: 30.52 MiB)

When aggregating use column selector and prefer integer, categorical, or pooled array grouping variable#

df = DataFrame(x=rand('a':'d', 10^7), y=1);
gdf = groupby(df, :x)

GroupedDataFrame with 4 groups based on key: x

First Group (2501514 rows): x = 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)
2501489 rows omitted
Rowxy
CharInt64
1a1
2a1
3a1
4a1
5a1
6a1
7a1
8a1
9a1
10a1
11a1
12a1
13a1
2501503a1
2501504a1
2501505a1
2501506a1
2501507a1
2501508a1
2501509a1
2501510a1
2501511a1
2501512a1
2501513a1
2501514a1

Last Group (2498598 rows): x = 'd': ASCII/Unicode U+0064 (category Ll: Letter, lowercase)
2498573 rows omitted
Rowxy
CharInt64
1d1
2d1
3d1
4d1
5d1
6d1
7d1
8d1
9d1
10d1
11d1
12d1
13d1
2498587d1
2498588d1
2498589d1
2498590d1
2498591d1
2498592d1
2498593d1
2498594d1
2498595d1
2498596d1
2498597d1
2498598d1

traditional syntax, slow

@btime combine(v -> sum(v.y), $gdf)
  15.117 ms (325 allocations: 19.10 MiB)
4×2 DataFrame
Rowxx1
CharInt64
1a2501514
2b2498412
3c2501476
4d2498598

use column selector

@btime combine($gdf, :y => sum)
  7.012 ms (186 allocations: 11.45 KiB)
4×2 DataFrame
Rowxy_sum
CharInt64
1a2501514
2b2498412
3c2501476
4d2498598
transform!(df, :x => categorical => :x);
gdf = groupby(df, :x)

GroupedDataFrame with 4 groups based on key: x

First Group (2501514 rows): x = CategoricalValue{Char, UInt32} 'a'
2501489 rows omitted
Rowxy
Cat…Int64
1a1
2a1
3a1
4a1
5a1
6a1
7a1
8a1
9a1
10a1
11a1
12a1
13a1
2501503a1
2501504a1
2501505a1
2501506a1
2501507a1
2501508a1
2501509a1
2501510a1
2501511a1
2501512a1
2501513a1
2501514a1

Last Group (2498598 rows): x = CategoricalValue{Char, UInt32} 'd'
2498573 rows omitted
Rowxy
Cat…Int64
1d1
2d1
3d1
4d1
5d1
6d1
7d1
8d1
9d1
10d1
11d1
12d1
13d1
2498587d1
2498588d1
2498589d1
2498590d1
2498591d1
2498592d1
2498593d1
2498594d1
2498595d1
2498596d1
2498597d1
2498598d1
@btime combine($gdf, :y => sum)
  6.969 ms (193 allocations: 12.03 KiB)
4×2 DataFrame
Rowxy_sum
Cat…Int64
1a2501514
2b2498412
3c2501476
4d2498598
transform!(df, :x => PooledArray{Char} => :x)
10000000×2 DataFrame
9999975 rows omitted
Rowxy
CharInt64
1a1
2a1
3a1
4b1
5a1
6c1
7d1
8d1
9b1
10c1
11b1
12b1
13c1
9999989b1
9999990a1
9999991b1
9999992d1
9999993d1
9999994a1
9999995d1
9999996d1
9999997b1
9999998d1
9999999b1
10000000b1
gdf = groupby(df, :x)

GroupedDataFrame with 4 groups based on key: x

First Group (2501514 rows): x = 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)
2501489 rows omitted
Rowxy
CharInt64
1a1
2a1
3a1
4a1
5a1
6a1
7a1
8a1
9a1
10a1
11a1
12a1
13a1
2501503a1
2501504a1
2501505a1
2501506a1
2501507a1
2501508a1
2501509a1
2501510a1
2501511a1
2501512a1
2501513a1
2501514a1

Last Group (2498598 rows): x = 'd': ASCII/Unicode U+0064 (category Ll: Letter, lowercase)
2498573 rows omitted
Rowxy
CharInt64
1d1
2d1
3d1
4d1
5d1
6d1
7d1
8d1
9d1
10d1
11d1
12d1
13d1
2498587d1
2498588d1
2498589d1
2498590d1
2498591d1
2498592d1
2498593d1
2498594d1
2498595d1
2498596d1
2498597d1
2498598d1
@btime combine($gdf, :y => sum)
  7.009 ms (188 allocations: 11.52 KiB)
4×2 DataFrame
Rowxy_sum
CharInt64
1a2501514
2b2498412
3c2501476
4d2498598

Use views instead of materializing a new DataFrame#

x = DataFrame(rand(100, 1000), :auto)
100×1000 DataFrame
900 columns and 75 rows omitted
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20x21x22x23x24x25x26x27x28x29x30x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51x52x53x54x55x56x57x58x59x60x61x62x63x64x65x66x67x68x69x70x71x72x73x74x75x76x77x78x79x80x81x82x83x84x85x86x87x88x89x90x91x92x93x94x95x96x97x98x99x100
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.9355080.2828370.8770780.844130.8705270.5023920.02194760.731170.2424220.09778790.7301150.552510.6540950.6408580.8384080.5107240.03467150.1369030.2496590.2734870.2326570.9574720.8448050.8127010.5894980.05085850.6887850.9691660.8477230.6814580.363170.2464280.8757760.185720.2009510.6840770.7279570.5600890.7592440.0452210.540170.1108520.5379110.9344180.5737760.3652340.2505450.8638690.1087690.05564730.6904570.7527010.3018290.09696860.9969220.5961230.9729590.3294780.8118530.3964990.9569830.3193990.09205560.9866540.1753370.5694080.7735970.1349140.8890060.1205670.4771220.6788240.7118370.06970780.1206920.5322240.2751870.8018210.7675780.6167630.556994
20.05181280.4316240.8610540.2531880.009205650.1529640.8218620.5990650.4936430.8652470.1129710.5344410.2806110.1403550.2766370.8113660.8105160.7456450.8707670.3566380.8817230.5117260.430610.5760550.07501770.6839970.6066950.5647380.1416490.5821170.5874650.3795320.6530790.05995590.06108930.7807420.2902710.2664640.8170840.1474410.3691410.7824360.7851570.933230.3631980.3016520.0949210.8604510.6004440.2548860.9305440.6203890.852340.5043180.4987580.4255820.2204430.4945310.9997020.5325730.4793430.1267670.309730.39480.697530.2606570.8981020.7820460.08064810.3657540.2691730.3417620.6668610.4804260.1553090.9414250.8697290.8818280.7563680.586150.7975190.2618440.8109640.05770360.2825480.642990.2851540.05118540.9376730.01659540.8716020.2907270.1857480.6451320.4556920.7448770.3989080.2358630.01723820.157506
30.8986620.7179850.2524690.684830.3719520.09638730.1769430.9294720.1922540.6057920.6483970.5318580.7003020.04084640.7727010.6514760.3750520.4878220.8661090.1381730.002991120.7720630.7151470.01310520.5551780.8617910.237160.5785930.457460.387440.5330270.3171450.8858610.390840.7778340.5039030.804630.01157110.5196630.6307380.6214130.9151160.1810020.1139390.02443490.5532140.5379040.9980620.002004460.4341350.08445990.2633960.5411310.7933990.7489690.4978160.6891790.6025330.8758380.6962040.2090880.787930.598160.8578320.5981750.7360860.6729820.9216850.1173550.8218650.6426970.6910330.5804950.5003640.03481660.05894260.7619110.7883730.3385580.2997610.5975520.6170570.7444830.2692490.8595210.6343670.6785270.5309860.3414390.6717470.5360340.7275090.04854320.6180440.1817250.6179290.7367470.01477660.6899820.928152
40.9450660.1596030.2965860.3556340.8068930.2401680.04748170.2034330.9517450.5953040.1560720.4679180.2122530.6613450.04037890.6509480.4016360.9448650.8093860.1441220.8050340.5272080.7397970.1929070.9844670.856860.6964160.09045730.01496750.615150.5387910.03960140.1106960.868630.6243170.1505550.6486410.4383510.2918520.9606280.1460950.7150150.7764770.5401140.5630720.9790480.6770970.5877370.5605730.6440310.5982530.3624070.8466210.3670370.9012990.4125030.9481260.5640.8570780.5015440.2834340.8729340.8117850.9885030.8112750.553430.9939470.1286930.9102520.2105550.06246670.2857340.601730.8725460.3676050.8186950.3806780.7648410.2515350.4009850.8699710.4871010.3982090.2266950.8175180.2518880.2311540.5463880.4809060.3654570.6603660.9456260.6403480.2690140.6061430.1856140.871250.6093090.07317410.696282
50.9917370.5188380.6264030.01499060.3603940.00473240.3025740.838530.3004620.156740.7463880.1902380.02219940.5150720.1544380.04828170.3631290.9348250.1384210.7164090.4117730.7575260.4072780.1994320.3861590.2994880.8936730.8137820.02637610.09464660.1967590.6640920.5267790.2745720.07499450.9893090.6847610.8479770.2402710.857870.8523230.1059570.397090.9018930.151480.01308230.2264680.3187150.5439110.6020610.8818460.1170820.3097990.8545670.03784240.2987610.9233450.3216440.07648620.0362510.6860.824890.1232720.9423270.9482230.1710740.5200130.1178320.03316620.6555750.4253430.9643150.4221350.9152150.3757150.6648950.3082440.0153420.09294990.4760170.9225160.1462560.9544820.3668220.7167650.2664050.6503610.8769230.5303130.4378830.3220440.08404080.6552160.3247630.8897090.1928370.2311690.7907420.3170690.226672
60.4587620.1206760.5532070.8753950.4964510.8825670.8962530.1277580.4305080.7025340.1343640.4589220.2520570.4666280.5595860.3821550.1594530.5966480.3638840.1236070.9366250.6076110.0792350.8877750.7995880.1631870.6281420.4827540.2293750.665650.7173230.794150.7542560.4827910.8418620.4037740.3767180.1860090.09562620.8475020.08750780.4550880.4254370.9373930.7839070.5059730.2152590.6001830.9788930.2083970.1422250.7900350.4287860.2576950.8307650.7409890.2386080.8015730.08585310.07342130.8015220.2920010.5712710.7033330.5599650.6137920.08615060.08212970.7651770.6183070.2987340.8567880.5492480.4060260.5839940.3494110.5160850.1885540.2263280.7156510.01986370.8465880.7531270.8340750.6204920.3629030.2457420.4638760.6281690.4688890.962620.735660.9957070.9379260.2537710.6922290.3137810.9178410.5594930.00182348
70.8976910.919690.7802470.6977170.4902130.5568360.8918860.8234190.20190.2582250.8693420.2921350.9683020.8235660.6779180.275330.9289540.1534190.4563270.1943860.3051160.5949220.1238770.735760.8847640.03829120.3010870.5622510.4757920.4754930.5139280.7515460.7031260.295890.5850730.8909620.1347720.1984310.5110070.07997770.1390680.3519190.486340.5641590.5193920.4755520.07917890.2209190.3884120.7796770.4377740.9628080.715420.994540.2057620.4431390.5301810.1606940.9701320.1234980.07549740.929290.7379450.9118810.6538130.6932830.4111880.217740.7173030.1926650.4315510.5101250.3490350.6417580.9399710.5927230.8607910.6933880.8864390.1172390.5722710.09301640.5813060.3652330.4037690.6493450.3446140.90.8833240.3524120.5161880.1409290.1925950.9891370.2083720.3366120.2723440.1708640.5955070.025991
80.3601760.1841660.7026790.6429360.4946880.1493840.5673580.2394420.8285550.3126310.3235330.402910.8417920.9223350.8815220.3905150.437720.6061860.3099790.9265840.2541940.5244380.5563850.9764770.756720.3134650.7149240.8383430.4180080.8081850.1814910.5126420.6851510.2100810.4177460.4207040.5600270.3500750.4189590.9497720.9414960.5329260.7143750.2186290.1625520.04987280.5331680.8333290.6038330.09792170.6133090.9518860.3212750.3458830.50040.2583030.7647550.3578240.9575210.04923760.4178870.1129410.6506590.9650460.8555730.5986350.9082660.7595210.9587490.4068820.8224460.7698390.2487230.006387550.9552770.9896990.3337050.7317510.6833570.9188640.3606420.3724740.1687960.2676020.5282340.7316220.8480430.8952750.1278140.9807250.2836040.280040.9930890.8361960.4719620.1488760.903170.745670.1816020.759762
90.7762180.7819120.6103560.6075790.3093280.7776440.5228160.4743420.7169390.04639050.1271730.8410670.7392220.977840.729540.356840.4099110.03099870.5156810.1453830.9781230.04366610.7273870.4706580.967890.3437010.7671330.4947490.6666890.2562230.1978910.7835770.33440.5808230.4458690.5219650.9864710.713810.7790940.9286580.6547140.1549750.2199460.2866120.8577740.3417460.00293520.8812180.5205790.9858040.6958080.006857130.4214050.1883530.9481220.579910.4990820.1648430.1504740.05096320.8582470.7721510.2841070.1214370.9088490.01381050.6602020.4216630.629010.5360770.9468270.3344710.6206290.7107560.519650.2317770.8024110.5567940.265020.704610.2988940.1640580.3141670.0008096590.8784560.9364730.1151440.9781860.503140.6207250.2603090.7293190.495950.1694310.2868470.4557390.856660.1720330.1156690.834543
100.1111450.7513120.08227450.9129680.6741560.8708460.4652260.7014940.9723520.7281110.5796330.09258330.6269080.0865130.1726040.3511980.5809040.4328920.1801490.6234990.4287950.7488240.1442050.8424550.09546330.2958220.175160.2311350.3511480.6492090.9409910.3664950.5292770.9235930.8661230.9579470.9815330.7121210.1098420.1264950.5303020.2165330.01987510.8014590.698860.7809930.7541130.03159090.2396060.6073880.905640.3197610.5444190.5533260.1324880.1950520.4617640.3837990.5188860.05257350.579420.521580.7767680.6382950.6490760.4432920.8555240.9856790.9092590.143680.4562380.9469420.3718470.6696770.4970830.4468040.9855710.9002060.747690.6092820.5794410.1065720.6564460.6953810.7521430.3133550.970090.6350520.1350570.3593880.457260.9881830.9717340.7116090.2987340.6873110.5598060.9112890.04645690.35505
110.1199910.1326120.01545780.3930480.9893340.3301420.8287210.5100560.1642070.3354580.3489030.5795220.8320990.8041310.3416270.4770590.05991610.4250.2595720.2395680.9650230.7114860.9149830.7195820.5907930.05380010.7188970.8190570.06202840.2786990.9737080.1682690.06427240.3333870.2712880.7641470.01272720.08491060.4098110.5931490.6838570.3458430.3181010.8582990.3439220.1497960.6440130.6919980.2532130.3650930.7593550.1502120.07493180.5872740.8320990.4748880.2085050.6219620.4841550.8670050.2492350.2763320.392190.9715760.5946080.2262680.6620430.3917960.04242860.8195720.9487920.5541720.4028520.3059450.005235650.0414560.8892410.3361840.9682530.7733770.9567240.4907550.3547140.6050310.7243760.5129010.8764890.07756240.8771990.785440.2137870.7569720.4292440.4495970.1433130.4709650.9437790.2695170.05250890.592346
120.2837660.514440.1490570.1289110.2485360.2187140.792230.1661480.6002640.3834170.6705910.6314130.4572130.4112880.9554390.1947410.884130.6172570.06641180.9257070.1696280.2103150.6597380.98030.02720760.7658620.607120.5353870.3500230.91520.9490860.9759620.7326570.2913450.306870.8368920.731540.5690590.5265660.9349570.3898510.4517780.6757060.5039680.05982520.5917060.5054220.4147730.1683510.1594090.6664130.2463880.04719720.2885630.7730620.1381270.3310650.5060160.4787110.362370.0008185540.04321030.5450350.327020.653940.4157360.6214490.449020.9206620.9460220.3367880.6502280.6463290.9058810.6905460.4794680.8239960.7866480.7239180.1223690.2942960.1400190.963990.4208450.8213080.5430360.4218380.9642820.9133520.3441110.4884730.5534930.3602060.3178060.6356470.9660330.7131090.1328810.1383370.529685
130.6293870.7896670.8642620.3343370.1046780.7808340.6766430.4747210.8751050.6977870.2663350.8943330.6399860.9427820.698280.2664870.4541840.6286630.0296880.9368070.2846040.2352320.9516090.00448290.02598610.08803180.2980220.3719570.9247820.3921750.2770990.5663380.7433140.1725210.3120540.3059090.6178930.4290580.1832650.05662140.7223110.300220.4986310.1904550.6042970.4005540.757310.4376590.6484450.9018140.2070040.4093340.783860.1641860.9846140.876220.4953250.815190.04114130.1246570.5253250.5063710.1867970.4636460.5042060.005243070.6181770.008933340.4729950.03416280.2325410.2482160.6459950.6862180.7624220.8963910.372180.1278930.3941560.1791070.6094960.827260.03615560.1824930.1015780.3000170.240170.8396810.8572510.2699950.7460530.3447790.1949070.1576080.9006880.5924290.2346390.3982570.4749940.435093
890.1995240.8203850.766060.6813540.9875370.8163680.1321670.5983680.03357320.654810.2198820.8258540.4191010.4204060.4465740.8753080.3632910.4477220.4842970.5589690.1611170.2032640.9590610.04103720.2316610.7371960.9439630.863980.2793630.3127970.3044010.04644060.3470230.5280890.7874860.8096770.2303270.09422880.160210.8928830.061350.9614220.3372250.07184960.6924070.3936420.7324490.07139180.186630.6394820.858420.513940.6392630.9064590.7642780.3169660.07044830.7695690.7804630.6660480.8462270.7624190.9831650.9484820.1584350.8180080.2040030.2735670.6692240.7041820.7806850.3028880.02013810.7431930.4250730.00292810.7253310.7145120.7938950.3063660.8025650.4560980.1191240.5557490.1335690.8730960.4191360.498870.6740930.9123430.8315820.05064230.2147430.1837650.2852150.6725620.6178990.03025560.2188910.991681
900.7212070.4963690.1414370.7775230.2429310.4361290.9950430.7979120.04362930.1147070.1668870.1741090.4508370.6337310.1283120.4385670.3455950.9908020.6957480.4372280.2228250.9415070.4120850.8928730.3770980.5385970.299440.9353240.9360070.2501670.6216540.9053710.9792130.2915350.6585840.484410.1138530.5108230.2856690.9046740.4969550.4127480.7555240.2790450.1781580.4348410.8240640.868750.8228480.07063720.5742350.2683680.2406540.5195850.2639910.8206920.7165530.9562890.8952830.1178120.2094920.7913490.5607940.352680.7365830.6896480.723560.6237550.79270.5950820.06234990.8227020.4437350.7925340.7219750.6853560.3277420.5620090.7331370.6054720.4655680.1459340.2268490.9495010.3183890.1802780.2387850.6229270.7576680.8383890.2058910.7823030.6472580.2488510.3907810.3239680.1340910.1393250.4278920.72248
910.4295510.5730130.9802450.2329360.1781640.1235220.8997850.4781070.4631290.6905420.3110450.08795080.4110910.7332570.9097670.2179720.6596790.7996380.7236740.4334120.6389270.1101250.08453720.3146430.3875260.9034150.6003620.6239040.7284580.4492040.7808470.5016760.8986960.5437420.03541890.5183940.624090.4876670.2840780.5278050.612390.972190.3885910.7857310.3346760.5009290.9267910.2928330.2355510.1191770.9977220.4514450.9107370.9749420.1739360.6711210.7322120.8870850.7568150.9215790.3904550.999340.6320620.2719110.187950.2796280.08010430.1927040.2796320.9630210.6132110.498380.830570.05456460.5864330.07853060.1876650.5250950.9944070.4242620.3656870.3464570.1983350.05132350.425330.546890.6772410.2327870.9070360.5279820.2768760.09535110.4493980.3565150.2225860.3709550.8496810.5521470.02258420.0491013
920.3287220.7560910.7307350.8053920.6998990.5074880.2008740.9049970.3004510.6992060.1387110.477920.2939180.271030.7849630.8522220.542650.9557930.5933990.9792120.7462450.4969930.09578580.1331050.257130.5710410.6464060.4522940.2318720.04307220.09774620.9483350.8960830.9454320.07544920.1750940.853130.2468270.9017020.8337060.9800960.6937440.9229550.8538660.2685490.9424250.8202940.209090.3969050.9484220.4825280.5166790.2597110.0911320.1897580.64140.197910.8250630.7695610.9064750.8238280.5462290.7497910.1994710.6066550.6541260.2187320.2214480.4298320.5418890.6110050.5484220.160640.2350690.428660.3544190.4893110.01643250.1606220.4109740.6925120.2032040.9091680.8330990.947460.3644440.5572030.7654450.9074590.9803660.5427250.3189870.7563620.6851750.2501730.4888010.6719050.3215920.5507120.470534
930.1964540.2919860.1896730.5909150.2157990.4916370.1127980.9965370.4317970.9877540.4755390.4522050.474310.3021370.01860240.271080.08986910.3593140.07989570.3793630.4455780.5069110.9459270.529230.7680440.2530940.05587770.8232880.7320350.6948890.4097740.129720.8737040.8507340.6600760.2164210.5788010.078920.9298270.204730.1153930.07906290.3817470.2060650.8856860.06709020.5768230.4680870.2347050.2183720.5691410.6995470.5573950.8031980.7790860.06816890.3136920.4615920.7375430.4565580.7226480.5815490.325650.9852260.6889960.5650030.3290030.8587030.9749180.2604450.04325730.2130010.1259620.6604740.4944760.1054220.5570410.3282930.7605240.9287040.1555040.6974490.1848650.4693220.9016270.9367830.06964020.09704350.6365560.6525580.5860960.7400890.5027580.2077970.1171150.8369550.1047720.5563710.4735730.574992
940.6980350.1138270.9840510.002341210.2841290.8790770.3719180.358560.5503050.1205270.4677330.2694860.7843990.2538370.799540.8080610.5731560.455370.6487630.8477610.2993010.9404550.5745670.01006980.650890.5178640.9879350.4530160.8393440.798120.1615420.4597380.0129880.5711210.2101280.9561550.5126860.3775220.1657420.03432930.6361570.5826070.2883290.8970720.5321530.3972850.5502350.419960.3724480.5356670.1108720.4957170.9660360.7953920.8776960.3164540.05187110.1585240.422550.9068680.124850.1816970.1778210.7168020.05421990.2794580.8504340.3162620.5414990.6485060.7650440.4459160.3846030.898760.8041040.1524080.2124540.8591180.467320.7773260.05207970.5684550.7222240.3742960.5421930.4220360.429570.7002920.6674870.0148260.9661930.4409880.747770.2182310.6753020.2892240.1127950.2439280.676540.58545
950.8380720.8735070.4894060.635210.273970.9010830.5110850.115310.4917430.3924060.03656560.4921670.3474530.4450710.1871060.09945540.9165560.765220.04190480.9374460.9679870.009027010.006778310.9641260.8742320.3464210.422530.4615530.441680.5440780.5389250.5928940.7520450.9280430.2336290.02644670.05350020.1870270.5582670.5723970.9622030.008299110.4865520.9024280.8808750.3916680.6133840.3181470.6120060.08329190.2608750.4379540.26830.9536750.6783930.3200960.8344020.8680640.818440.318080.3612890.7500430.5093310.4254750.08963880.7871290.5346970.6501840.03653250.1738280.4246350.4847440.5774280.4945110.4964840.7115120.847830.8554890.4895080.8833160.5258720.3947570.9449760.9797430.1755530.6757130.8241950.3787290.3290070.3803730.3113480.8966530.4976920.8031680.2057110.4090820.6804430.8098380.5264430.358172
960.6502310.2998720.2449610.9016080.9783470.3822290.5186680.7353890.5603210.2433050.9900140.4919260.9809990.3594380.3160180.8219820.1730550.9935220.5620820.5238430.5827560.1390510.6541710.6177090.3577050.4924920.1956760.8232450.03990390.636850.3475980.9098220.2065140.4070950.6931530.6281220.2146740.5782340.3881730.01429650.7084780.6310850.2064040.6986650.8027720.659140.6727380.8218930.5657440.516210.7163720.9605990.641530.9168710.6014240.315860.5066180.9147310.4074810.3990590.0507110.5196860.3205520.8637250.3312220.1142510.9118150.1770670.4609590.7101930.3948390.1816730.4846090.1968320.9066020.284470.4605260.2289450.5465810.7088410.7039910.9079780.3013330.6474070.6663730.7675860.3212710.2015920.02353850.5428550.2606290.3779570.8306950.493220.2155210.2564570.4125140.7404750.02184620.873768
970.5009480.5770760.722090.3182550.9799420.1271380.9012530.9428620.664130.2874970.3555370.6485750.2327570.7518850.1428780.8592280.09267230.5877350.3393790.1938960.3039210.1881190.6914970.7972630.9642620.824560.9857640.2801290.1918460.6422110.05560450.832230.00154230.128990.3502960.7745070.7344760.7251920.09832880.3644470.9388710.8783590.5991050.2594830.1828430.4663910.6031770.1522420.07163160.0572820.7261590.944780.4986690.1069390.4560120.8349310.460350.3866320.6454290.5924360.658170.8980820.8984960.029120.7778250.7684930.9560830.6069620.5265770.4571730.1174570.6925260.5355440.8074950.4060670.841280.6512380.8913480.6255850.6484170.5267260.3862850.8750860.5966220.7183670.9125030.6660840.1590380.2962410.9157790.9712440.4289510.2764620.05611390.6284730.5628450.247620.9973750.8407580.664162
980.4281240.6006880.8579560.8373940.8892290.3394140.6921190.511790.5561340.8450090.3913260.662870.9252560.9252020.7490670.4499690.02180250.1760240.9767210.7118180.526120.2225350.9432770.8976480.5693480.5373570.8063470.5024580.6113520.4580650.1792120.1302760.848530.2669080.974570.325620.1715630.8314790.3871950.2821750.130040.2367230.3602670.5448420.6082650.1762410.9567650.4072690.7768420.06780490.7356270.1345820.3053410.693810.2762360.7838770.2725860.5687620.3537480.3664380.03437240.934860.6469090.5813680.03057510.2094250.8784090.4415390.9642660.7041480.5141770.6611940.5288930.8168940.0657250.6042320.9355870.4328030.3068910.5493480.6381940.6665970.6000480.6936470.5949230.4873710.6699440.04784560.004576610.429120.9744850.9913130.3611930.7599760.5374610.5012310.6158860.6057420.2898230.393555
990.806890.03764490.5290510.06523050.8686570.188160.3346610.0634810.5181340.7261460.5573930.7806640.4956580.3365470.351990.6922520.3190310.1590060.3633380.4656140.2024890.9701080.4135870.4645340.5588640.07848240.2772590.01697470.526810.08263360.3633250.03939030.6354920.5975950.24190.1507430.7528870.3100770.07191890.9364440.09531520.7117230.5133050.1248880.3081540.2114240.4878140.3846750.3271470.7464790.1290690.5243250.9740120.9646230.623420.07354210.4424920.3249390.3096510.7600460.02453260.4528670.2618910.7096030.5941270.3554370.4900690.7631690.3376950.5190450.9177120.923820.4247230.04538630.9943220.2998850.4404640.4266790.2018620.9194370.6970990.5997430.007789260.2108220.3248190.6336690.2950990.8086080.1939170.4844960.3906550.7294340.4884270.1833480.2646670.4047290.1226040.002828890.9123030.882001
1000.5296370.6816210.6635470.7093020.9511040.5969450.311680.8919460.9329080.3416370.2263850.2303840.04077440.1668110.01283620.6813190.2221080.6552020.03938560.7841790.7149750.6155420.4757010.3431290.9127080.9246690.1008730.414110.5798270.5798310.6999570.141580.1705790.5877780.9231070.9003190.9419530.7142210.7018760.5302260.7754620.4785910.8527710.6678870.6897960.008120140.4144740.7771720.2914190.1574030.7915430.04152750.6630990.5396810.9641520.799470.8983430.834110.1129080.8054010.4080630.8354810.5837160.2200220.9141980.5524990.3061720.1346890.580550.5598350.5549710.8752350.588920.5431930.5021630.366370.6504270.4109110.8128280.0801910.7146880.9084170.6609160.5831410.8242690.1640410.3907260.003394040.459950.788230.5647890.3017190.009624490.9692490.8864540.421110.2631290.1990.4305450.532452
@btime $x[1:1, :]
  186.699 μs (2986 allocations: 159.50 KiB)
1×1000 DataFrame
900 columns omitted
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20x21x22x23x24x25x26x27x28x29x30x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51x52x53x54x55x56x57x58x59x60x61x62x63x64x65x66x67x68x69x70x71x72x73x74x75x76x77x78x79x80x81x82x83x84x85x86x87x88x89x90x91x92x93x94x95x96x97x98x99x100
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.9355080.2828370.8770780.844130.8705270.5023920.02194760.731170.2424220.09778790.7301150.552510.6540950.6408580.8384080.5107240.03467150.1369030.2496590.2734870.2326570.9574720.8448050.8127010.5894980.05085850.6887850.9691660.8477230.6814580.363170.2464280.8757760.185720.2009510.6840770.7279570.5600890.7592440.0452210.540170.1108520.5379110.9344180.5737760.3652340.2505450.8638690.1087690.05564730.6904570.7527010.3018290.09696860.9969220.5961230.9729590.3294780.8118530.3964990.9569830.3193990.09205560.9866540.1753370.5694080.7735970.1349140.8890060.1205670.4771220.6788240.7118370.06970780.1206920.5322240.2751870.8018210.7675780.6167630.556994
@btime $x[1, :]
  22.814 ns (0 allocations: 0 bytes)
DataFrameRow (1000 columns)
900 columns omitted
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20x21x22x23x24x25x26x27x28x29x30x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51x52x53x54x55x56x57x58x59x60x61x62x63x64x65x66x67x68x69x70x71x72x73x74x75x76x77x78x79x80x81x82x83x84x85x86x87x88x89x90x91x92x93x94x95x96x97x98x99x100
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.9355080.2828370.8770780.844130.8705270.5023920.02194760.731170.2424220.09778790.7301150.552510.6540950.6408580.8384080.5107240.03467150.1369030.2496590.2734870.2326570.9574720.8448050.8127010.5894980.05085850.6887850.9691660.8477230.6814580.363170.2464280.8757760.185720.2009510.6840770.7279570.5600890.7592440.0452210.540170.1108520.5379110.9344180.5737760.3652340.2505450.8638690.1087690.05564730.6904570.7527010.3018290.09696860.9969220.5961230.9729590.3294780.8118530.3964990.9569830.3193990.09205560.9866540.1753370.5694080.7735970.1349140.8890060.1205670.4771220.6788240.7118370.06970780.1206920.5322240.2751870.8018210.7675780.6167630.556994
@btime view($x, 1:1, :)
  22.823 ns (0 allocations: 0 bytes)
1×1000 SubDataFrame
900 columns omitted
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20x21x22x23x24x25x26x27x28x29x30x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51x52x53x54x55x56x57x58x59x60x61x62x63x64x65x66x67x68x69x70x71x72x73x74x75x76x77x78x79x80x81x82x83x84x85x86x87x88x89x90x91x92x93x94x95x96x97x98x99x100
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.9355080.2828370.8770780.844130.8705270.5023920.02194760.731170.2424220.09778790.7301150.552510.6540950.6408580.8384080.5107240.03467150.1369030.2496590.2734870.2326570.9574720.8448050.8127010.5894980.05085850.6887850.9691660.8477230.6814580.363170.2464280.8757760.185720.2009510.6840770.7279570.5600890.7592440.0452210.540170.1108520.5379110.9344180.5737760.3652340.2505450.8638690.1087690.05564730.6904570.7527010.3018290.09696860.9969220.5961230.9729590.3294780.8118530.3964990.9569830.3193990.09205560.9866540.1753370.5694080.7735970.1349140.8890060.1205670.4771220.6788240.7118370.06970780.1206920.5322240.2751870.8018210.7675780.6167630.556994
@btime $x[1:1, 1:20]
  4.098 μs (51 allocations: 4.28 KiB)
1×20 DataFrame
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.935508
@btime $x[1, 1:20]
  23.447 ns (0 allocations: 0 bytes)
DataFrameRow (20 columns)
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.935508
@btime view($x, 1:1, 1:20)
  23.156 ns (0 allocations: 0 bytes)
1×20 SubDataFrame
Rowx1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
10.8559080.9990160.7904080.2688320.4952860.7494960.3331780.02779310.3527120.3293040.6915650.0691950.7961350.9520.739320.3283480.7345150.1269880.3419580.935508