[Numpy-discussion] The problem with arrays

yogesh karpate yogeshkarpate@gmail....
Tue Sep 22 12:30:17 CDT 2009


On Tue, Sep 22, 2009 at 7:01 PM, Fabrice Silva <silva@lma.cnrs-mrs.fr>wrote:

> Le mardi 22 septembre 2009 à 17:42 +0530, yogesh karpate a écrit :
> > I just tried your idea but the result is same. it didnt help .
> >
> > 2009/9/22 Nadav Horesh <nadavh@visionsense.com>
> >         A quick answer with going into the details of your code:
> >
> >         try
> >          plt.plot(R_time,R_amp,'go',hold=1)
> >         (one line before the last)
> >
> >          Nadav
>
> You may separate the computation part and the plotting one by storing
> your results in a R_time and a R_amp array (length a1 arrays).
>
> Concerning the plotting issue : are you sure the points you want to be
> displayed aren't yet? print the values within the loop :
> >>>     print (R_amp, R_time)
> to check your values.
> You may also inspect your graphs to see how many lines they have :
> >>> plt.gca().get_children()
> or
> >>> plt.gca().get_lines()
> might help.
>
   This is the main thing . When I try to store it in array like
R_time=array([R_t[0][i]]). It just stores the final value in that array when
loop ends.I cant get out of this For loop.I really have this small problem.
I really need help on this guys.

> for i in range(a1):
>         data_temp=(bpf[left[0][i]:right[0][i]])# left is an array and
> right is also an array
>         maxloc=data_temp.argmax()       #taking indices of  max. value of
> data segment
>         maxval=data_temp[maxloc]
>         minloc=data_temp.argmin()
>         minval=data_temp[minloc]
>         maxloc = maxloc-1+left # add offset of present location
>         minloc = minloc-1+left # add offset of present location
>         R_index = maxloc
>         R_t = t[maxloc]
>         R_amp = array([maxval])
>         S_amp = minval#%%% Assuming the S-wave is the lowest
>         #%%% amp in the given window
>         #S_t = t[minloc]
>         R_time=array([R_t[0][i]])
>         plt.plot(R_time,R_amp,'go');
>         plt.show()
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090922/ec85be6a/attachment.html 


More information about the NumPy-Discussion mailing list