Better methods for showing metadata
还没有人认领这个 Issue。
评估
调研方向
首先检查现有的 colmetadata API,以及 names(df) 如何公开表列。比较提议的 showcolmetadata 重载及其示例输出,然后检查当前关于元数据显示的测试或文档;当所请求的列和标签组合能够以可读的表格输出形式得到支持时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I'm using metadata for the first time today (I usually use Stata and R for data cleaning) and I found it helpful to define the following functions to make it easier to see metadata
function showcolmetadata(df, col::Union{AbstractString, Symbol}, label::AbstractString)
colmetadata(df, col, label)
end
function showcolmetadata(df, cols::AbstractVector{<:Union{AbstractString, Symbol}}, label::AbstractString)
labvals = [colmetadata(df, col, label) for col in cols]
nt = (; :variable => cols, Symbol(label) => labvals)
pretty_table(nt; nosubheader = true, crop = :horizontal, alignment = [:l, :l])
end
function showcolmetadata(df, col::Union{AbstractString, Symbol}, labels::AbstractVector{<:AbstractString})
labvals = [colmetadata(df, col, label) for label in labels]
nt(; :label => labels, :value => labvals)
pretty_table(nt; nosubheader = true, tile = "colmetadata for $col", crop = :horizontal, alignment = [:l, :l])
end
function showcolmetadata(df, cols::Colon, label::AbstractString)
showcolmetadata(df, names(df), label)
end
function showcolmetadata(df, col::Union{AbstractString, Symbol}, labels::Colon)
d = colmetadata(df, col)
labnames = names(d)
showcolmetadata(df, col, labnames)
end
They would be used like following: You can see that the column names are pretty uninformative in the Penn World Tables, exactly the kind of situation metadata is great for.
julia> showcolmetadata(pwt[:, 1:10], :, "label")
┌───────────────┬──────────────────────────────────────────────────────────
│ variable │ label ⋯
├───────────────┼──────────────────────────────────────────────────────────
│ countrycode │ 3-letter ISO country code ⋯
│ country │ Country name ⋯
│ currency_unit │ Currency unit ⋯
│ year │ Year ⋯
│ rgdpe │ Expenditure-side real GDP at chained PPPs (in mil. 2017 ⋯
│ rgdpo │ Output-side real GDP at chained PPPs (in mil. 2017US$) ⋯
│ pop │ Population (in millions) ⋯
│ emp │ Number of persons engaged (in millions) ⋯
│ avh │ Average annual hours worked by persons engaged (source: ⋯
│ hc │ Human capital index, see note hc ⋯
└───────────────┴──────────────────────────────────────────────────────────
1 column omitted
- 主要语言
- Julia
- 星标
- 19
- 派生
- 1
- 平均合并
- 8 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaData/TableMetadataTools.jl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
JuliaData/TableMetadataTools.jl#4 · 1 个 reaction ·
查看 JuliaData/TableMetadataTools.jl 的全部 Issue
相似的 Issue
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updated可能已有人在做 @ali-ramadhan 今天认领。 未关闭bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
CliMA/Oceananigans.jl#6381 ·
维护者通常 1 天内回复
-
ci system:windows test
难度 1/5 1 小时以内 新手友好度 76/100
维护者通常 1 天内回复
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)未关闭
难度 1/5 1-3 小时 新手友好度 82/100
NumericalEarth/Breeze.jl#1143 ·
维护者通常 1 天内回复
-
format-check (Runic) is red on master: formatter drift on ~200 files可能已有人在做 @ChrisRackauckas-Claude 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
SciML/ModelingToolkit.jl#5337 · 1 条评论 ·
维护者通常 3 天内回复
-
bug parsers
难度 2/5 1-3 小时 新手友好度 72/100
lanl-ansi/GasModels.jl#366 ·