When using pd.pivot_table(df, index=[col1], values=[val1]), the resulting pivot table drops results from df where col1 is NaN.
I can pre-fill the NaN with df[col1].fillna('#', inplace=True) but that's amending the data, which I do not want to do.
I can also do df2 = df.copy() before doing pre-fill to df2 as above, but my data is large, thus do not want to do extra copies unnecessarily.
Is there a way I can pivot a dataframe with NaN values in columns designated as index, without the resulting pivot dropping the NaN index and its aggregated values?