Jul-24-2023, 03:41 PM
(This post was last modified: Jul-24-2023, 03:41 PM by deanhystad.)
I ran your code and the dropna worked fine for me. Print the table before and after the dropna and you will see the NaNs are gone. For help on the pivot table you need to provide more information. Other than not saving the results of the pivot, it also appears to work.
Output:SPECIALITY general ortho_trauma pediatric trauma trauma surgery
DOCUMENTED
0.0 5.535367e+09 44554564.0 6.546545e+09 NaN
1.0 3.113313e+06 NaN NaN 5454543.0
The NAN's here are valid as there are no undocumented (0.0) trama surgery or documented (1.0) ortho_trama or pediatric trama. What are you trying to do?