I have a function that pulls tables from our a table in our SQL server into a dataframe in Python, but it forces all the column headers to be lower case. The code is as follows:
connection = pypyodbc.connect('Driver={SQL Server};'
'Server=' + server + ';'
'Database=' + database + ';'
'uid=' + username + ';'
'pwd=' + password + ';')
query = 'SELECT * FROM ' + tableName
#set dict value to dataframe imported from SQL
tableDict[tableName] = pd.read_sql(query, connection)
The headers in SQL are for example: pmiManufacturingHeadline_Level It shows up in my pandas dataframe as: pmimanufacturingheadline_level
Anyone have an idea how to make pandas.read_sql keep the original capitalization?