switch transpose to do scalars rather than an ndarray