Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for JLD2 I/O #3365

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/src/man/importing_and_exporting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Importing and Exporting Data (I/O)

## JLD2 Files

A convenient format for reading and writing DataFrames in JLD2 which saves and loads
alex-s-gardner marked this conversation as resolved.
Show resolved Hide resolved
Julia data structures in a format comprising a subset of HDF5. Unlike several other
formats, JLD2 preserves custom Types. The save and load functions, provided by FileIO,
provide a mechanism to read/write `DataFrame` from/to a JLD2 file.
alex-s-gardner marked this conversation as resolved.
Show resolved Hide resolved

A `DataFrame` can be saved as a JLD2 file at path `output.jld2` using
alex-s-gardner marked this conversation as resolved.
Show resolved Hide resolved
```julia
using FileIO
alex-s-gardner marked this conversation as resolved.
Show resolved Hide resolved
using Pkg; Pkg.add("JLD2")

df = DataFrame(x=1, y=2)
save("output.jld2", Dict("df" => df))
```

and can be read using
```julia
load("output.jld2") # -> Dict{String, Any} with 1 entry: "df" => 1×2 DataFrame
```

## CSV Files

For reading and writing tabular data from CSV and other delimited text files,
Expand Down