Python Forum
slice python array on condition
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
slice python array on condition
#3
AlekseyPython's code is correct, however might be a bit confusing with the dictionary named the same as one of it's elements,

Easier to understand if:
zipped_dict = dict(zip(Labels, Load))
print(f"zipped_dict element 'A' = {zipped_dict['A']}")
Reply


Messages In This Thread
slice python array on condition - by Gigux - Nov-03-2019, 09:47 AM
RE: slice python array on condition - by Larz60+ - Nov-03-2019, 07:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 1,496 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Fix pandas copy/slice warning. deanhystad 3 2,558 Sep-07-2023, 03:18 PM
Last Post: deanhystad
  Slice creates new objects? fmr300 4 3,260 Jul-20-2022, 12:34 PM
Last Post: fmr300
  InvalidIndexError: (slice(None, None, None), slice(None, -1, None)) SuperNinja3I3 1 6,553 Jul-15-2022, 05:59 AM
Last Post: Larz60+
  Python Pandas: How do I sumproduct by rows with an if condition? JaneTan 2 7,196 Jul-13-2021, 11:36 AM
Last Post: jefsummers
  Indexing [::-1] to Reverse ALL 2D Array Rows, ALL 3D, 4D Array Columns & Rows Python Jeremy7 8 10,435 Mar-02-2021, 01:54 AM
Last Post: Jeremy7
  Slice list Moris526 1 2,286 Dec-24-2020, 02:19 AM
Last Post: deanhystad
  increase and decrease a slice value? KEYS 2 2,959 Nov-10-2020, 11:35 PM
Last Post: KEYS
  Removing some elements from array based on a condition claw91 0 2,216 Oct-27-2020, 03:42 PM
Last Post: claw91
  else condition not called when if condition is false Sandz1286 10 8,279 Jun-05-2020, 05:01 PM
Last Post: ebolisa

Forum Jump:

User Panel Messages

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