From f69ea45bf5b0bf1f7f7fd4cc585549b641cd4ec9 Mon Sep 17 00:00:00 2001 From: Gabriel Dansereau Date: Fri, 24 Jul 2020 17:50:18 -0400 Subject: [PATCH] show fewer DataFrame rows to reduce memory spike --- docs/src/examples/gbif.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/src/examples/gbif.md b/docs/src/examples/gbif.md index 50da46b8..c55f9560 100644 --- a/docs/src/examples/gbif.md +++ b/docs/src/examples/gbif.md @@ -82,7 +82,8 @@ to a `DataFrame`: ```@example temp using DataFrames -kf_df = DataFrame(kf_occurrences) +kf_df = DataFrame(kf_occurrences); +last(kf_df, 5) ``` We can then extract the temperature values for all the occurrences: @@ -101,21 +102,23 @@ We can also export all the values from a layer to a `DataFrame` with their corresponding coordinates: ```@example temp -temperature_df = DataFrame(temperature_clip) +temperature_df = DataFrame(temperature_clip); +last(temperature_df, 5) ``` Or do so with multiple layers at the same time: ```@example temp climate_clip = [temperature_clip, precipitation_clip] -climate_df = DataFrame(climate_clip) -rename!(climate_df, :x1 => :temperature, :x2 => :precipitation) +climate_df = DataFrame(climate_clip); +rename!(climate_df, :x1 => :temperature, :x2 => :precipitation); +last(climate_df, 5) ``` We can finally plot the values in a similar way: ```@example temp -filter!(x -> !isnothing(x.temperature) && !isnothing(x.precipitation), climate_df) +filter!(x -> !isnothing(x.temperature) && !isnothing(x.precipitation), climate_df); histogram2d(climate_df.temperature, climate_df.precipitation, c=:viridis) scatter!(temperature_clip[kf_df], precipitation_clip[kf_occurrences], lab="", c=:white, msc=:orange) ``` \ No newline at end of file