public static function invert($arr)
    {
        if (!$arr) {
            return [];
        }

        $result = array();

        foreach ($arr as $columnName => $column) {
            foreach ($column as $rowName => $cell) {
                $result[$rowName][$columnName] = $cell;
            }
        }

        return $result;
    }