unnecessary change

Giorgi Lekishvili gleki at gol.ge
Wed Oct 24 14:11:33 EDT 2001


Thanx to all!

I have solved this by the following way:
first, I created a new matrix:
tmp=Matrix(MLab.rand(m,n))
and then I copied each element from the initial matrix to the tmp.
Of cource, this is not an optimal way, but when I use copy.deepcopy(from_m), the
destination matrix becomes integer, i.e., the data become rounded.

Can this be overcome?

Regards,
Giorgi

" Kerim Borchaev ( WarKiD )" wrote:

> Hello Giorgi,
>
>   try this( works for me ):
>
>   self.Mactual=Numeric.array(self.Mdata)
>
> Best regards,
>  Kerim                            mailto:warkid at storm.ru
>
> Tuesday, October 23, 2001, 10:54:23 PM, you wrote:
>
> GL> Hi folks!
>
> GL> My problem is the following:
> GL> I want to save initial data matrix, as e.g., follows
> GL>     self.Mdata=Matr
> GL> In the same time I need a matrix, which is used and processed. The
> GL> latter is created as follows
> GL>     self.Mactual=self.Mdata
>
> GL> No the problem is, that, when I have finished to use the Mactual matrix,
> GL> self.Mdata is always changed and equals the final Mactual matrix.
>
> GL> What is the systematic solution of the problem?
>
> GL> Thanx in advance,
> GL> Giorgi
>
> GL> PS. I use Numeric module.




More information about the Python-list mailing list