Python Forum
Indexing [::-1] to Reverse ALL 2D Array Rows, ALL 3D, 4D Array Columns & Rows Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indexing [::-1] to Reverse ALL 2D Array Rows, ALL 3D, 4D Array Columns & Rows Python
#4
(Feb-22-2021, 08:46 AM)DeaD_EyE Wrote: You should try: https://numpy.org/doc/stable/reference/g...numpy-flip
Thanks for your help; I'm aware of numpy.flip(). numpy.flip() works great, but I wanted to only use the index. I got the following answers with some help from Stack Overflow and another source:
[:,::-1] reverses 2D array rows, [:,::-1,:] reverses 3D array columns, [:,:,::-1] reverses 3D array rows, [:,:,::-1,:] reverses 4D array columns, [:,:,:,::-1] reverses 4D array rows
Reply


Messages In This Thread
RE: Indexing [::-1] to Reverse ALL 2D Array Rows, ALL 3D, 4D Array Columns & Rows Python - by Jeremy7 - Feb-22-2021, 11:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python code to calculate mean of an array of numbers using numpy viren 3 180 May-29-2024, 04:49 PM
Last Post: Gribouillis
  Writing a cycle to find the nearest point from the array Tysrusko 0 224 May-10-2024, 11:49 AM
Last Post: Tysrusko
  This result object does not return rows. It has been closed automatically dawid294 6 1,491 Mar-30-2024, 03:08 AM
Last Post: NolaCuriel
  Elegant way to apply each element of an array to a dataframe? sawtooth500 7 587 Mar-29-2024, 05:51 PM
Last Post: deanhystad
  Concatenate array for 3D plotting armanditod 1 351 Mar-21-2024, 08:08 PM
Last Post: deanhystad
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 6,107 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  How Write Part of a Binary Array? Assembler 1 443 Jan-14-2024, 11:35 PM
Last Post: Gribouillis
  How is pandas modifying all rows in an assignment - python-newbie question markm74 1 794 Nov-28-2023, 10:36 PM
Last Post: deanhystad
  Loop over an an array of array Chendipeter 1 656 Nov-28-2023, 06:37 PM
Last Post: deanhystad
  How to remove some elements from an array in python? gohanhango 9 1,570 Nov-28-2023, 08:35 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020