Re: Goto

2017-12-29 Thread MarkA
On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote:

> How to use goto in python?
> 
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com

Rather than ask how to use an unavailable statement (GOTO), why not 
investigate why no modern languages use it?

-- 
MarkA

You can safely assume that you have created God in your own image when it 
turns out that God hates all the same people you do.  -- Anne Lamott
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem with assignment. Python error or mine?

2017-12-21 Thread MarkA
On Thu, 21 Dec 2017 07:05:33 -0800, rafaeltfreire wrote:
From docs.python.org:

8.10. copy — Shallow and deep copy operations

Source code: Lib/copy.py

Assignment statements in Python do not copy objects, they create bindings 
between a target and an object. For collections that are mutable or 
contain mutable items, a copy is sometimes needed so one can change one 
copy without changing the other. This module provides generic shallow and 
deep copy operations (explained below)...


> Dear community, I am having the following problem when I am assigning
> the elements of a vector below a certain number to zero or any other
> value.
> I am creating a new variable but Python edits the root variable. Why?
> 
> import numpy as np
> 
> X=np.arange(1, 1, 1) #root variable x1=X x1[x1<1]=0
> 
> print(X)
> Out[1]: array([ 0.,  0.,  0., ...,  0.,  0.,  0.])
> 
> Why? It is supposed to be the original value Thank you for your
> time Rafael



-- 
MarkA

We hang petty theives, and appoint the great theives to public office
  -- Aesop
-- 
https://mail.python.org/mailman/listinfo/python-list