[Python-Dev] AutoNumber Enum (original) (raw)
Wes Turner wes.turner at gmail.com
Thu Jun 30 02:33:22 EDT 2016
- Previous message (by thread): [Python-Dev] AutoNumber Enum
- Next message (by thread): [Python-Dev] AutoNumber Enum
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
It may be worth mentioning that pandas Categoricals are mutable and zero-based: https://pandas-docs.github.io/pandas-docs-travis/categorical.html
Serialization to SQL and CSV is (also?) lossy, though:
https://pandas-docs.github.io/pandas-docs-travis/categorical.html#getting-data-in-out
https://pandas-docs.github.io/pandas-docs-travis/io.html#io-stata-categorical On 06/29/2016 03:40 PM, Roberto MartÃnez wrote:
Why the 'start' parameter default is 1? 0 (zero) is more consistent with
other parts of the language: indexes, enumerate, range...
An excerpt from [1]:
The reason for defaulting to 1 as the starting number and not 0 is that 0 > is False in a boolean sense, but enum members all evaluate to True. >
Ethan
[1] https://docs.python.org/3/library/enum.html#functional-api
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/wes.turner%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20160630/75b85b8f/attachment.html>
- Previous message (by thread): [Python-Dev] AutoNumber Enum
- Next message (by thread): [Python-Dev] AutoNumber Enum
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]