DataFrameTools.jl Documentation

Functions

DataFrameTools.file_formatFunction
file_format(file::AbstractString)::Symbol

Returns the file format from the file suffix.

Arguments

  • file::AbstractString: file path
source
DataFrameTools.compressFunction
compress(f::Function, file::AbstractString, subfile::AbstractString)

Creates a compressed file. The type of compression is inferred from the output file name. subfile is the name of the file within the compressed archive. f is a function which writes to the archive.

The typical use case is:

compress(file, subfile) do io
    # put here the body of function f(io) to write to io
end

Arguments

  • f::Function: function to execute on the file contents
  • file::AbstractString: compressed file path
  • subfile::AbstractString: subfile within the archive
source
DataFrameTools.uncompressFunction
uncompress(f::Function, file::AbstractString)

Uncompresses a compressed file. The type of compression is inferred from the output file name. f is a function which reads from the archive.

The typical use case is:

uncompress(file) do io
    # put here the body of function f(io) to write to io
end

Arguments

  • f::Function: function to execute on the file contents
  • file::AbstractString: file path
source
DataFrameTools.df_writeFunction
df_write(file::AbstractString, df::DataFrame; subformat::Union{Nothing,Symbol}=nothing, dictencode::Bool=true)

Writes a DataFrame to a file. The file suffix determines how the DataFrame is serialized. If the file has a compressed suffix, subformat determines how the DataFrame is serialized in the compressed archive.

Arguments

  • file::AbstractString: file path
  • df::DataFrame: dataframe to export
  • subformat::Union{Nothing,Symbol}=nothing: format to used within a compressed archive.
  • dictencode::Bool=true: true to use a dictionary encoding, if possible, and false otherwise.
source
DataFrameTools.df_readFunction
df_read(file::AbstractString; dates_as_strings::Bool=true, missing_type::Type=String, missing_types::Dict{String,Type}=Dict{String,Type}())::DataFrame

Reads a DataFrame from a file. The file suffix determines how the DataFrame is deserialized.

Arguments

  • file::AbstractString: file path
  • dates_as_strings::Bool=true: true to parse dates as strings; false to parse dates as dates.
  • missing_type::Type=String: type to use if all values are missing,
  • missing_types::Dict{String,Type}=Dict{String,Type}(): type to use for missing columns
source

Index