Skip to content

Display categorical data variables with natural labels instead of numerical indices #17

Open
@00krishna

Description

@00krishna

One feature we would like to introduce is the ability to show categorical data in a dataframe with natural label. Categorical data is encoded with a numerical key and generally text value, such as Dict( 1 => "january, 2 => "february", 3 => "march", ...). When looking at a dataframe, the current view shows the numerical keys, because these indicates are saved in the original data.

The example below is manufactured, but shows what the current view will look like.

julia> DataFrame(month = [1, 2, 3], sensor1 = [2.1, 2.4, 5.1])
3×2 DataFrame
 Row │ month  sensor1 
     │ Int64  Float64 
─────┼────────────────
   1 │     1      2.1
   2 │     2      2.4
   3 │     3      5.1

Instead we would like this data to display in a more natural and intuitive manner, showing the text labels. And example of this would look like:

Row │ month     sensor1 
     │ String    Float64 
─────┼───────────────────
   1 │ january       2.1
   2 │ february      2.4
   3 │ march         5.1

One step to doing this is with potentially separating the LabelledArrays type from the ReadStatTables.jl package.

We have asked if the owners of that package could separate the LabelledArrays type into a separate package. That way, we could import just the array type, and not the entire ReadStatTables.jl package as a dependency.

We are tracking that request at:

junyuan-chen/ReadStatTables.jl#41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions