Last active
August 26, 2015 15:02
-
-
Save grisaitis/170e82a008480acb4fa3 to your computer and use it in GitHub Desktop.
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
# For a comment on this SO answer: http://stackoverflow.com/a/19726078/781938 | |
import pandas as pd | |
# create a DataFrame with two columns: 'a' and 'A' | |
data = pd.DataFrame({'a':[1],'A':[2]}) | |
# print the result | |
print data | |
# prints: | |
# A a | |
# 0 2 1 | |
# convert the column names to lowercase | |
data.columns = map(str.lower, data.columns) | |
# print again | |
print data | |
# prints | |
# a a | |
# 0 2 1 | |
# print column 'a' | |
print data['a'] | |
# prints: | |
# a a | |
# 0 2 1 | |
# which is a little funky |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment