Hello,
I am importing a csv from an AWS S3 bucket into a pandas dataframe. I am using pandas to clean up the values and column names, mainly by converting all strings to upper case. The column names and values in the csv are in lower case, and that is not desired for us. The code below does a nice job of making everything upper case:
df.columns = df.columns.str.upper()
for col in df.select_dtypes(include=['object']).columns:
df[col] = df[col].str.upper()
cleaned_up_values_df = df.set_index('OBJECTID')However, the problem occurs when I use df.spatial.to_table to export the dataframe to a memory table format compatible with arcpy. All of the column names and values convert back to the original lower case formatting. This is the code I use:
cleaned_up_values_df.spatial.to_table(r'memory/out_table')
Am I missing a parameter with pandas? I'd prefer to not use arcpy to change the column names again since pandas makes it so easy. TIA.
Edit: I should also mention this script will run on a nightly schedule and will need to be able to overwrite the memory table each time.