From ac116b4accad7fa4b6866f7a06474f0fb554939e Mon Sep 17 00:00:00 2001 From: Nick Eubank Date: Sun, 26 Nov 2017 12:29:38 -0600 Subject: [PATCH 1/3] Update docs Closes #114 --- src/Source.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Source.jl b/src/Source.jl index c56239db..0817d3d3 100644 --- a/src/Source.jl +++ b/src/Source.jl @@ -244,7 +244,7 @@ Keyword Arguments: * `categorical::Bool=true`: read string column as a `CategoricalArray` ([ref](https://github.com/JuliaData/CategoricalArrays.jl)), as long as the % of unique values seen during type detection is less than 67%. This will dramatically reduce memory use in cases where the number of unique values is small. Note by default, "string" or text columns will be parsed as the [`WeakRefString`](https://github.com/quinnj/WeakRefStrings.jl) type. This is a custom type that only stores a pointer to the actual byte data + the number of bytes. -To convert a `String` to a standard Julia string type, just call `string(::WeakRefString)`, this also works on an entire column. +To convert a `String` to a standard Julia string type, just call `string(::WeakRefString)` for an individual observation, or `string.(::WeakRefString)` on an entire column. Oftentimes, however, it can be convenient to work with `WeakRefStrings` depending on the ultimate use, such as transfering the data directly to another system and avoiding all the intermediate copying. Example usage: From baec40d5c997b9a9e3858d32bdbbb6bc359077c3 Mon Sep 17 00:00:00 2001 From: Nick Eubank Date: Fri, 8 Dec 2017 10:06:19 -0600 Subject: [PATCH 2/3] Update WeakRefString to String conversion docs --- src/Source.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Source.jl b/src/Source.jl index 0817d3d3..df3e2625 100644 --- a/src/Source.jl +++ b/src/Source.jl @@ -244,7 +244,7 @@ Keyword Arguments: * `categorical::Bool=true`: read string column as a `CategoricalArray` ([ref](https://github.com/JuliaData/CategoricalArrays.jl)), as long as the % of unique values seen during type detection is less than 67%. This will dramatically reduce memory use in cases where the number of unique values is small. Note by default, "string" or text columns will be parsed as the [`WeakRefString`](https://github.com/quinnj/WeakRefStrings.jl) type. This is a custom type that only stores a pointer to the actual byte data + the number of bytes. -To convert a `String` to a standard Julia string type, just call `string(::WeakRefString)` for an individual observation, or `string.(::WeakRefString)` on an entire column. +To convert a `String` to a standard Julia string type, use either `df[:col] = convert(Array{String}, df[:col])` or `df[:col] = convert(Array{Union{String, Missing}}, df[:col])`, depending on whether one wishes the column to support values of `missing`. Oftentimes, however, it can be convenient to work with `WeakRefStrings` depending on the ultimate use, such as transfering the data directly to another system and avoiding all the intermediate copying. Example usage: From aa38fd57993cedde54f2f1eb9099145be365e74e Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Fri, 8 Dec 2017 17:20:26 +0100 Subject: [PATCH 3/3] Avoid mentioning df (as it's not necessarily obvious what it means) --- src/Source.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Source.jl b/src/Source.jl index df3e2625..839d21c7 100644 --- a/src/Source.jl +++ b/src/Source.jl @@ -244,7 +244,7 @@ Keyword Arguments: * `categorical::Bool=true`: read string column as a `CategoricalArray` ([ref](https://github.com/JuliaData/CategoricalArrays.jl)), as long as the % of unique values seen during type detection is less than 67%. This will dramatically reduce memory use in cases where the number of unique values is small. Note by default, "string" or text columns will be parsed as the [`WeakRefString`](https://github.com/quinnj/WeakRefStrings.jl) type. This is a custom type that only stores a pointer to the actual byte data + the number of bytes. -To convert a `String` to a standard Julia string type, use either `df[:col] = convert(Array{String}, df[:col])` or `df[:col] = convert(Array{Union{String, Missing}}, df[:col])`, depending on whether one wishes the column to support values of `missing`. +To convert a string column `col` to a standard Julia `String` vector, use either `convert(Array{String}, col)` or `convert(Array{Union{String, Missing}}, col)`, depending on whether the column supports `missing` values. Oftentimes, however, it can be convenient to work with `WeakRefStrings` depending on the ultimate use, such as transfering the data directly to another system and avoiding all the intermediate copying. Example usage: