Apr 10, 2018 Using applyalongaxis (NumPy) or apply (Pandas) is a more Pythonic way of iterating through data in NumPy and Pandas. But there may be occasions you wish to simply work your way through rows or columns in NumPy and Pandas. Here is how it is done. NumPy is set up to iterate through rows when a loop is declared.
Note: Ensure that you copy the data to do this, since using the Cut command or Ctrl+X won’t work.Choose a new location in the worksheet where you want to paste the transposed table, ensuring that there is plenty of room to paste your data. The new table that you paste there will entirely overwrite any data / formatting that’s already there.Right-click over the top-left cell of where you want to paste the transposed table, then choose Transpose.After rotating the data successfully, you can delete the original table and the data in the new table will remain intact.Tips for transposing your data.If your data includes formulas, Excel automatically updates them to match the new placement.
Verify these formulas use absolute references—if they don’t, you can before you rotate the data.If you want to rotate your data frequently to view it from different angles, consider so that you can quickly pivot your data.