numbers as categories should equal their string representations
See original GitHub issueI would expect this to generate 3 categories (a, b, 1) but it generates 4 - two identical 1’s:
Plotly.newPlot(gd,[{x:['a','b',1,'1'],y:[1,2,3,4]}],{xaxis:{type:'category'}})
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
The Numbers Classes - Java Tutorials
Returns an integer, given a string representation of decimal, binary, octal, or hexadecimal ( radix equals 10, 2, 8, or 16 respectively) numbers...
Read more >Transforming Categorical Data | Machine Learning
You can represent categorical values as strings or even numbers, but you won't be able to compare these numbers or subtract them from...
Read more >How to determine whether a string represents a numeric value
In this article. To determine whether a string is a valid representation of a specified numeric type, use the static TryParse method that...
Read more >Categorical data — pandas 1.5.2 documentation
Equality semantics Two instances of CategoricalDtype compare equal whenever they have the same categories and order. When comparing two unordered categoricals, ...
Read more >How can I change a string variable into a numeric variable?
Another way to recode gender, or any string variable for which you want a numeric representation of the categories, is to use the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Generally I’m not an advocate of automatic type coercions so if asked yesterday, I’d have said, expecting 4 things would seem natural. Coercing to strings will make it sort them as strings by default, e.g. “2” > “10”. But based on the above discussion it looks like coercion would be the more natural fit for the library and I have no overriding argument of any kind.
Found this. Will be fixed as part of https://github.com/plotly/plotly.js/pull/2489