キャストに問題がありthis dataframeます。newname種の頻度 ( を使用)main_habitatと市区町村 ( munc) を、行に and を、列にmain_habitat一致する頻度を使用して表示したいと思います。newnamemunc
main_haitat newname munc1 munc2 munc3
A X 1 1 0
A Y 0 1 1
B Y ...
B Z ...
...
これに関するヘルプは大歓迎です!