Python Forum
Replace elements of array with elements from another array based on a third array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace elements of array with elements from another array based on a third array
#7
That is a brute force ugly way to do it. Look at my post again and think about this problem in terms of x and y. x will be things like "first", "second", "third" and y will be things like "0" or "1". How do you change "first" to an array index? How do you change "0" to a number.

This assumes you have to use the clubby "No change" or "Change third element to 1" strings to enter changes. This isn't too difficult to parse, but it would be better if no parsing was required.
Reply


Messages In This Thread
RE: Replace elements of array with elements from another array based on a third array - by deanhystad - May-13-2022, 06:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Good way to ignore case when searching elements? Winfried 1 153 Apr-25-2024, 12:39 PM
Last Post: menator01
  Elegant way to apply each element of an array to a dataframe? sawtooth500 7 431 Mar-29-2024, 05:51 PM
Last Post: deanhystad
  Concatenate array for 3D plotting armanditod 1 290 Mar-21-2024, 08:08 PM
Last Post: deanhystad
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 5,914 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  unable to remove all elements from list based on a condition sg_python 3 458 Jan-27-2024, 04:03 PM
Last Post: deanhystad
  How Write Part of a Binary Array? Assembler 1 358 Jan-14-2024, 11:35 PM
Last Post: Gribouillis
  Loop over an an array of array Chendipeter 1 595 Nov-28-2023, 06:37 PM
Last Post: deanhystad
  How to remove some elements from an array in python? gohanhango 9 1,210 Nov-28-2023, 08:35 AM
Last Post: Gribouillis
  IPython errors for numpy array min/max methods muelaner 1 573 Nov-04-2023, 09:22 PM
Last Post: snippsat
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 493 Oct-17-2023, 09:46 AM
Last Post: tomciodev

Forum Jump:

User Panel Messages

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