I created pivot table from dataframe used below code
table = pd.pivot_table(df_table, values=['KPI Amount Convert to USD'], index=['Customer Nick', 'Customer',
'Customer Name', 'BSO Name', 'BSO Comment',
'Pay Date, Recovery action, No pay schedule reason '],
columns=['Range'], aggfunc={'KPI Amount Convert to USD': np.sum}, margins=True,
margins_name='Grand Total')
it works great, but some value are NaN (other are regular number)
when I used
table = table.replace(np.nan, '', regex=True)
the NaN value are empty, BUT some value are changed to 3.0176e+06, even before it was 3017601.99.
Do you have any idea how to replace NaN value, but preserve int format of other?
thanks for your advice