/ bitvec2arrow.jl
bitvec2arrow.jl
1 using DataFrames, Arrow 2 3 """ 4 # bitvec2arrow(filename, vector) 5 6 Given the filename as a **String** and a **BitVector**, convert the 7 vector into a **DataFrame** and save the result as an **Arrow** file. 8 The vector is expected to consist of the **boolean** type. The **DataFrame** 9 column name is set to **OR_result**. 10 11 This function depends on these packages: 12 - Arrow 13 - DataFrames 14 15 ## Examples 16 17 ```julia-repl 18 julia> bitvec2arrow("C:\\User\\Data\\mydata.arrow", BitVector([true, true, false])) 19 ``` 20 21 The DataFrame is generated as: 22 ```shell 23 3×1 DataFrame 24 Row │ OR_result 25 │ Bool 26 ─────┼────────────── 27 1 │ true 28 2 │ true 29 3 │ false 30 ``` 31 """ 32 function bitvec2arrow(filename::String, vec::BitVector) 33 Arrow.write(filename, 34 DataFrame(OR_result=vec); compress=:lz4) 35 end