Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Turn list of arrays into an array of lists
Post: RE: Turn list of arrays into an array of lists

It is quite complicated to reproduce this in a simplified way but I will give it a try. I hope it will be clear. First of all I have an array of the form: first_array=np.array([0, 0, 0, 0, 0, 1, 2, ...
Cola_Reb Data Science 6 1,731 Jul-20-2022, 06:55 PM
    Thread: Turn list of arrays into an array of lists
Post: RE: Turn list of arrays into an array of lists

(Jul-19-2022, 05:21 PM)paul18fr Wrote: If you change "array" to "np.array" and int64 to "int", then at least the code works: import numpy as np first_array=[np.array([[1, 0, 2, 4, 3]], dtype=int),...
Cola_Reb Data Science 6 1,731 Jul-20-2022, 01:05 PM
    Thread: Turn list of arrays into an array of lists
Post: Turn list of arrays into an array of lists

Hey everyone, I am currently struggling with the structure of data I receive. As a result of another (not important here) function I get a list filled with numpy arrays at a large scale (about 20 tho...
Cola_Reb Data Science 6 1,731 Jul-19-2022, 04:08 PM
    Thread: Replace elements of array with elements from another array based on a third array
Post: RE: Replace elements of array with elements from a...

(May-13-2022, 04:55 PM)deanhystad Wrote: Is there a pattern to the statements? It looks like they will either be "No change" or "Change x element to y". How can you convert "x" and "y" to indices?...
Cola_Reb General Coding Help 6 1,889 May-13-2022, 05:14 PM
    Thread: Replace elements of array with elements from another array based on a third array
Post: RE: Replace elements of array with elements from a...

I tried something similiar to this: for input_value in np.nditer(inputarray): if input_value == 'Change second element to 1': targetarray = replacement_array[1] ....But this a...
Cola_Reb General Coding Help 6 1,889 May-13-2022, 04:27 PM
    Thread: Replace elements of array with elements from another array based on a third array
Post: Replace elements of array with elements from anoth...

I hope I can explain my current problem in a understandable way (besides from the possible confusing title **rolleyes**): I need to replace some elements of Array 1 with corresponding elements from A...
Cola_Reb General Coding Help 6 1,889 May-13-2022, 01:00 PM
    Thread: Change elements of array based on position of input data
Post: RE: Change elements of array based on position of ...

Ah now I got it. Thanks! **smile**
Cola_Reb General Coding Help 6 2,144 May-13-2022, 12:57 PM
    Thread: Change elements of array based on position of input data
Post: RE: Change elements of array based on position of ...

(May-05-2022, 05:28 PM)deanhystad Wrote: def bit_flags(bits, on=True, off=False): return [on if bit in bits else off for bit in range(1, max(bits)+1)] bits = list(map(int, input("Enter values ...
Cola_Reb General Coding Help 6 2,144 May-07-2022, 06:01 PM
    Thread: Change elements of array based on position of input data
Post: RE: Change elements of array based on position of ...

(May-05-2022, 05:15 PM)ibreeden Wrote: That is easy. From your examples I guess it is all about the numbers 1 to 6. Is it a dice-game? The easyest way is as follows. Thank you very much for your sol...
Cola_Reb General Coding Help 6 2,144 May-06-2022, 10:02 AM
  Question Thread: Change elements of array based on position of input data
Post: Change elements of array based on position of inpu...

Hey everyone, hope you are doing great these days. I have a difficult problem with my data processing and hope you could help me: I have some input data of the following form: Number of entries to co...
Cola_Reb General Coding Help 6 2,144 May-05-2022, 02:01 PM

User Panel Messages

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