Created
July 21, 2015 18:30
-
-
Save dbspringer/643254008e6784aa749e to your computer and use it in GitHub Desktop.
Python one-liner to convert spreadsheet column to zero-based index. e.g. 'A' -> 0, 'AA' -> 26, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
col2num = lambda col: reduce(lambda x, y: x*26 + y, [ord(c.upper()) - ord('A') + 1 for c in col])-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment