NCDataFrame.jl

Read & write netcdf file via DataFrames
Author Axect
Popularity
1 Star
Updated Last
1 Year Ago
Started In
February 2021

NCDataFrame.jl

Read & write NetCDF file via DataFrames.

Manual

Install

using Pkg

Pkg.add("NCDataFrame")

Read

using NCDataFrame

df = readnc("data.nc") # DataFrame

Write

using NCDataFrame
using DataFrames

df = DataFrame()
df[!,:x] = 1:10
df[!,:y] = 'a':'j'

writenc(df, "data.nc")

Fill missing

fillmissing(1:3, 5)         # [1,2,3,missing,missing]
fillmissing([1,2,3], 5)     # [1,2,3,missing,missing]
fillmissing(1:5, 5)         # 1:5
fillmissing([1,2,3,4,5], 5) # [1,2,3,4,5]

Tips for different length vectors

using NCDataFrame
using DataFrames

df = DataFrame()
df[!, :x] = fillmissing(1:3, 5)     # [1,2,3,missing,missing]
df[!, :y] = 1:5                     # [1,2,3,4,5]

writenc(df, "data.nc")              # It works!

dg = readnc("data.nc")              # It works too!
dg[!,:x] |> skipmissing |> collect  # Remove missing from x

References

NCDataFrame.jl uses below packages inside.

Used By Packages

No packages found.