Skip to content

Commit

Permalink
Update for DataFrames 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Jul 16, 2019
1 parent a6f4f8f commit 8f3ef03
Show file tree
Hide file tree
Showing 14 changed files with 1,494 additions and 1,413 deletions.
146 changes: 75 additions & 71 deletions 01_constructors.ipynb

Large diffs are not rendered by default.

370 changes: 247 additions & 123 deletions 02_basicinfo.ipynb

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions 03_missingvalues.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"metadata": {},
"source": [
"# Introduction to DataFrames\n",
"**[Bogumił Kamiński](http://bogumilkaminski.pl/about/), April 30, 2019**"
"**[Bogumił Kamiński](http://bogumilkaminski.pl/about/), July 16, 2019**"
]
},
{
Expand All @@ -14,7 +14,7 @@
"metadata": {},
"outputs": [],
"source": [
"using DataFrames # load package"
"using DataFrames"
]
},
{
Expand Down Expand Up @@ -1159,10 +1159,14 @@
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.0.3",
"display_name": "Julia 1.1.0",
"language": "julia",
"name": "julia-1.0"
"name": "julia-1.1"
},
"language_info": {
"file_extension": ".jl",
Expand Down
68 changes: 36 additions & 32 deletions 04_loadsave.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"metadata": {},
"source": [
"# Introduction to DataFrames\n",
"**[Bogumił Kamiński](http://bogumilkaminski.pl/about/), April 27, 2019**"
"**[Bogumił Kamiński](http://bogumilkaminski.pl/about/), July 16, 2019**"
]
},
{
Expand All @@ -14,7 +14,7 @@
"metadata": {},
"outputs": [],
"source": [
"using DataFrames # load package"
"using DataFrames"
]
},
{
Expand Down Expand Up @@ -194,13 +194,13 @@
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr><tr><th></th><th>Bool</th><th>Int64⍰</th><th>String⍰</th><th>String⍰</th></tr></thead><tbody><p>3 rows × 4 columns</p><tr><th>1</th><td>true</td><td>1</td><td>missing</td><td>a</td></tr><tr><th>2</th><td>false</td><td>2</td><td>b</td><td>missing</td></tr><tr><th>3</th><td>true</td><td>missing</td><td>c</td><td>c</td></tr></tbody></table>"
"<table class=\"data-frame\"><thead><tr><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr><tr><th></th><th>Bool</th><th>Int64⍰</th><th>String⍰</th><th>String⍰</th></tr></thead><tbody><p>3 rows × 4 columns</p><tr><th>1</th><td>true</td><td>1</td><td>missing</td><td>a</td></tr><tr><th>2</th><td>false</td><td>2</td><td>b</td><td>missing</td></tr><tr><th>3</th><td>true</td><td>missing</td><td>c</td><td>c</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& A & B & C & D\\\\\n",
"\t\\hline\n",
"\t& Bool & Int64⍰ & String⍰ & String⍰\\\\\n",
"\t& Bool & Int64⍰ & String⍰ & String⍰\\\\\n",
"\t\\hline\n",
"\t1 & true & 1 & & a \\\\\n",
"\t2 & false & 2 & b & \\\\\n",
Expand All @@ -210,7 +210,7 @@
"text/plain": [
"3×4 DataFrame\n",
"│ Row │ A │ B │ C │ D │\n",
"│ │ \u001b[90mBool\u001b[39m │ \u001b[90mInt64⍰\u001b[39m │ \u001b[90mString⍰\u001b[39m │ \u001b[90mString⍰\u001b[39m │\n",
"│ │ \u001b[90mBool\u001b[39m \u001b[90mInt64⍰\u001b[39m │ \u001b[90mString⍰\u001b[39m │ \u001b[90mString⍰\u001b[39m │\n",
"├─────┼───────┼─────────┼─────────┼─────────┤\n",
"│ 1 │ true │ 1 │ \u001b[90mmissing\u001b[39m │ a │\n",
"│ 2 │ false │ 2 │ b │ \u001b[90mmissing\u001b[39m │\n",
Expand Down Expand Up @@ -241,8 +241,8 @@
{
"data": {
"text/plain": [
"4-element Array{Union,1}:\n",
" Union{Missing, Bool} \n",
"4-element Array{Type,1}:\n",
" Bool \n",
" Union{Missing, Int64} \n",
" Union{Missing, String}\n",
" Union{Missing, String}"
Expand Down Expand Up @@ -635,25 +635,25 @@
"output_type": "stream",
"text": [
"First run\n",
" 0.745948 seconds (814.64 k allocations: 40.707 MiB, 4.48% gc time)\n",
" 1.050906 seconds (830.88 k allocations: 42.539 MiB, 2.87% gc time)\n",
" 0.213652 seconds (427.49 k allocations: 21.266 MiB)\n",
" 0.318751 seconds (373.35 k allocations: 25.882 MiB, 9.61% gc time)\n",
" 1.234840 seconds (1.37 M allocations: 68.621 MiB, 3.34% gc time)\n",
" 1.502894 seconds (929.64 k allocations: 47.285 MiB, 1.93% gc time)\n",
" 0.275374 seconds (427.33 k allocations: 21.270 MiB, 5.51% gc time)\n",
" 0.352993 seconds (397.80 k allocations: 27.044 MiB, 3.63% gc time)\n",
"Second run\n",
" 0.024630 seconds (54.97 k allocations: 1.052 MiB)\n",
" 0.016964 seconds (5.53 k allocations: 340.375 KiB)\n",
" 0.022761 seconds (4.81 k allocations: 243.089 KiB)\n",
" 0.018969 seconds (34.02 k allocations: 9.008 MiB)\n"
" 0.024408 seconds (6.57 k allocations: 292.781 KiB)\n",
" 0.017290 seconds (5.54 k allocations: 342.203 KiB)\n",
" 0.019022 seconds (4.81 k allocations: 243.089 KiB)\n",
" 0.042060 seconds (34.02 k allocations: 9.023 MiB, 28.03% gc time)\n"
]
},
{
"data": {
"text/plain": [
"4-element Array{Int64,1}:\n",
" 558378\n",
" 558578\n",
" 84439\n",
" 54072"
" 558383\n",
" 558583\n",
" 84312\n",
" 54096"
]
},
"execution_count": 20,
Expand All @@ -663,9 +663,9 @@
],
"source": [
"bigdf = DataFrame(rand(Bool, 10^3, 10^2))\n",
"bigdf[1] = Int.(bigdf[1])\n",
"bigdf[2] = bigdf[2] .+ 0.5\n",
"bigdf[3] = string.(bigdf[3], \", as string\")\n",
"bigdf[!, 1] = Int.(bigdf[!, 1])\n",
"bigdf[!, 2] = bigdf[!, 2] .+ 0.5\n",
"bigdf[!, 3] = string.(bigdf[!, 3], \", as string\")\n",
"println(\"First run\")\n",
"@time CSV.write(\"bigdf1.csv\", bigdf)\n",
"@time bigdf |> save(\"bigdf2.csv\")\n",
Expand All @@ -689,15 +689,15 @@
"output_type": "stream",
"text": [
"First run\n",
" 0.622640 seconds (802.64 k allocations: 28.521 MiB, 2.97% gc time)\n",
" 1.679781 seconds (2.60 M allocations: 218.270 MiB, 8.63% gc time)\n",
" 0.042708 seconds (72.82 k allocations: 2.008 MiB)\n",
" 0.673740 seconds (639.10 k allocations: 32.375 MiB, 4.97% gc time)\n",
" 0.112875 seconds (86.70 k allocations: 4.845 MiB)\n",
" 1.787776 seconds (2.63 M allocations: 219.289 MiB, 6.75% gc time)\n",
" 0.044459 seconds (72.82 k allocations: 2.008 MiB)\n",
" 0.562682 seconds (640.06 k allocations: 32.471 MiB, 4.13% gc time)\n",
"Second run\n",
" 0.048690 seconds (52.07 k allocations: 1.326 MiB)\n",
" 0.099486 seconds (506.49 k allocations: 108.821 MiB, 54.91% gc time)\n",
" 0.006630 seconds (49.60 k allocations: 951.719 KiB)\n",
" 0.007290 seconds (26.39 k allocations: 1.200 MiB)\n"
" 0.010963 seconds (2.15 k allocations: 85.773 KiB)\n",
" 0.101021 seconds (506.69 k allocations: 108.049 MiB, 52.35% gc time)\n",
" 0.007702 seconds (49.60 k allocations: 952.109 KiB)\n",
" 0.007236 seconds (26.39 k allocations: 1.201 MiB)\n"
]
}
],
Expand Down Expand Up @@ -733,10 +733,14 @@
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.0.3",
"display_name": "Julia 1.1.0",
"language": "julia",
"name": "julia-1.0"
"name": "julia-1.1"
},
"language_info": {
"file_extension": ".jl",
Expand Down
Loading

0 comments on commit 8f3ef03

Please sign in to comment.