Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plot correct values
#5
(Feb-16-2017, 05:13 PM)merlem Wrote:
(Feb-16-2017, 04:45 PM)Felipe Wrote: The idea is use "originT" to store the value of "T" every time that enter in the while. So I can change the value of "T"...

And what happens to the value of "originT" in that moment?
Maybe try a copy instead, it can be done with a minor code change:
originT = T[:]

I tried that and doesn't work. I really don't understand the problem.

I use:
originB = B
B = B + cte
Them, when I print "originB" and "B" that's ok. These arrays has different values.

But if I use:
originT = T
dx = len(T)

for i in range(dx):
    if T[i] >= 0:
        T[i] = T[i] + cte
    else:
        T[i] = T[i] - cte
When I print "originT" and "T", they have the same value. Why? If change "T" means change "originT", the same would be true for "originB" and "B".
Reply


Messages In This Thread
Plot correct values - by Felipe - Feb-16-2017, 01:38 PM
RE: Plot correct values - by merlem - Feb-16-2017, 04:03 PM
RE: Plot correct values - by Felipe - Feb-16-2017, 04:45 PM
RE: Plot correct values - by merlem - Feb-16-2017, 05:13 PM
RE: Plot correct values - by Felipe - Feb-16-2017, 06:17 PM
RE: Plot correct values - by merlem - Feb-16-2017, 07:05 PM
RE: Plot correct values - by Felipe - Feb-16-2017, 10:43 PM
RE: Plot correct values - by merlem - Feb-17-2017, 08:29 AM
RE: Plot correct values - by Felipe - Feb-17-2017, 11:57 AM
RE: Plot correct values - by merlem - Feb-18-2017, 09:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplotlib scatter plot in loop with None values ivan_sc 1 2,297 Nov-04-2021, 11:25 PM
Last Post: jefsummers
  How to create correct scatter plot for PCA? LK91 0 2,133 Dec-11-2019, 07:53 PM
Last Post: LK91
  Substituting Values in Plot Hotdog1 2 3,119 Nov-11-2017, 08:07 PM
Last Post: Hotdog1

Forum Jump:

User Panel Messages

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