{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/1496","repository_url":"https://api.github.com/repos/JuliaData/DataFrames.jl","labels_url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/1496/labels{/name}","comments_url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/1496/comments","events_url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/1496/events","html_url":"https://github.com/JuliaData/DataFrames.jl/issues/1496","id":355607785,"node_id":"MDU6SXNzdWUzNTU2MDc3ODU=","number":1496,"title":"Show of categorical values in a DataFrame","user":{"login":"bkamins","id":6187170,"node_id":"MDQ6VXNlcjYxODcxNzA=","avatar_url":"https://avatars3.githubusercontent.com/u/6187170?v=4","gravatar_id":"","url":"https://api.github.com/users/bkamins","html_url":"https://github.com/bkamins","followers_url":"https://api.github.com/users/bkamins/followers","following_url":"https://api.github.com/users/bkamins/following{/other_user}","gists_url":"https://api.github.com/users/bkamins/gists{/gist_id}","starred_url":"https://api.github.com/users/bkamins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkamins/subscriptions","organizations_url":"https://api.github.com/users/bkamins/orgs","repos_url":"https://api.github.com/users/bkamins/repos","events_url":"https://api.github.com/users/bkamins/events{/privacy}","received_events_url":"https://api.github.com/users/bkamins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-08-30T14:20:07Z","updated_at":"2018-08-31T13:26:52Z","closed_at":null,"author_association":"MEMBER","body":"Consider a following example:\r\n\r\n```\r\njulia> df = DataFrame(A = categorical([1,2]), B=categorical(1.0:2.0), C=categorical([\"a\",\"b\"]))\r\n2×3 DataFrame\r\n│ Row │ A                                │ B                                    │ C │\r\n├─────┼──────────────────────────────────┼──────────────────────────────────────┼───┤\r\n│ 1   │ CategoricalValue{Int64,UInt32} 1 │ CategoricalValue{Float64,UInt32} 1.0 │ a │\r\n│ 2   │ CategoricalValue{Int64,UInt32} 2 │ CategoricalValue{Float64,UInt32} 2.0 │ b │\r\n```\r\n\r\nWe have two issues here:\r\n1. Inconsistency in showing `CategoricalString` and `CategoricalValue`\r\n2. `CategoricalValue` is displayed very verbosely.\r\n\r\nI think it would be better to:\r\n1. omit printing type information for `CategoricalValue`\r\n2. add some visual indication that a column is `CategoricalValue` or `CategoricalString`; two ideas are: using a different color to print column name or putting some mark (a star?) in front of column name instead of a space, so it would look like this:\r\n\r\n```\r\njulia> df = DataFrame(A = categorical([1,2]), B=categorical(1.0:2.0), C=categorical([\"a\",\"b\"]))\r\n2×3 DataFrame\r\n│ Row │*A │*B   │*C │\r\n├─────┼───┼─────┼───┤\r\n│ 1   │ 1 │ 1.0 │ a │\r\n│ 2   │ 2 │ 2.0 │ b │\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/comments/417663587","html_url":"https://github.com/JuliaData/DataFrames.jl/issues/1496#issuecomment-417663587","issue_url":"https://api.github.com/repos/JuliaData/DataFrames.jl/issues/1496","id":417663587,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzY2MzU4Nw==","user":{"login":"nalimilan","id":1120448,"node_id":"MDQ6VXNlcjExMjA0NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1120448?v=4","gravatar_id":"","url":"https://api.github.com/users/nalimilan","html_url":"https://github.com/nalimilan","followers_url":"https://api.github.com/users/nalimilan/followers","following_url":"https://api.github.com/users/nalimilan/following{/other_user}","gists_url":"https://api.github.com/users/nalimilan/gists{/gist_id}","starred_url":"https://api.github.com/users/nalimilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalimilan/subscriptions","organizations_url":"https://api.github.com/users/nalimilan/orgs","repos_url":"https://api.github.com/users/nalimilan/repos","events_url":"https://api.github.com/users/nalimilan/events{/privacy}","received_events_url":"https://api.github.com/users/nalimilan/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T13:26:52Z","updated_at":"2018-08-31T13:26:52Z","author_association":"CONTRIBUTOR","body":"Looks nice, but we should also treat a sequence of digits as a word, i.e. never cut it in the middle. Currently `Int64` gives `Int6`. It should also be fine to allow them beyond 4 characters as long (as the sequence doesn't go beyond 9).\r\n\r\nFinally, to avoid confusion, we could add an ellipsis when the name is abbreviated."}}
{"actor":{"display_login":"nalimilan"}}