Pandas seems to be stripping leading characters from records in a table, and I'm not sure why. Each record is 5 numbers, and some are preceded by a symbol (-, +, ~). ex: ~12345, +67890, -99999.
Using the code below, I read the data from a .xls into a dataframe, drop a field, rename a field, rename the sheet, and rearrange the columns. Last, it is saved as a .xlsx.
The end product looks good, aside from the fact that the records in CDP_PLACEFP have the symbols stripped. I.e., the values above become 123456, 67890, -99999 (for some reason the minus is not removed like the others).
The initial table contains the correct values. Is there an explicit command I need to give to prevent this?
arcpy.TableToExcel_conversion(cheapet_cdp_changes, cheapet_table_initial)
df = pd.read_excel(cheapet_table_initial)
df = df.drop(['FID'], axis=1) #Drop FID column
df = df.rename(columns={"TEMP_FP":"CDP_PLACEFP"}) #Rename TEMP_FP to CDP_PLACEFP
df = df.reindex(columns = ['PRIM_ID', 'STATEFP', 'COUNTYFP', 'CDP_PLACEFP']) #Rearrange columns
df.to_excel(os.path.join(pf, 'CHEAPET_{}.xlsx'.format(stcou)), sheet_name = 'CHEAPET', index=False)