1
続きからquestionpandasピボットテーブルの列ヘッダーを交換するにはどうすればいいですか?
このようにピボットした後、データフレームを取得しました。
AVG GrossProfit AVG PMV Loss% Sales ParentAuction Copart IAA Copart IAA Copart IAA Copart IAA Make Acura 112.99 NaN -15.53 NaN 36.46 NaN 96.0 NaN
この列の形式に列レベルを変更するにはどうすればよいですか。 MultiIndex
をソートするためのsort_index
と
ParentAuction Copart IAA AVG GrossProfit AVG PMV Loss% Sales AVG GrossProfit AVG PMV Loss% Sales Make Acura 112.99 -15.53 36.46 96.0 NaN NaN NaN NaN