On 09/09/11 11:44, kitty wrote:
...I have been an R user for 7 years and and am
finding it difficult to do even basic things in python,
If you are trying to do the kinds of things that R is good at in Python
you will find it involves a lot more work. That's because Python is a
general purpos
Peter Otten wrote:
Steven D'Aprano wrote:
# Get ten random samples, sampling with replacement.
samples = [random.choice(subset) for i in range(10)]
That may include subset items more than once.
Hence the "sampling with replacement" comment.
Use the aptly named
random.sample(subset, 10
Peter Otten wrote:
> Steven D'Aprano wrote:
>
>> # Get ten random samples, sampling with replacement.
I can quote. But not read ;(
>> samples = [random.choice(subset) for i in range(10)]
Sorry for the noise.
___
Tutor maillist - Tutor@python.org
T
Steven D'Aprano wrote:
> # Get ten random samples, sampling with replacement.
> samples = [random.choice(subset) for i in range(10)]
That may include subset items more than once. Use the aptly named
random.sample(subset, 10)
to avoid that.
___
Tu
kitty wrote:
> Hi,
>
> I'm new to python and I have read through the tutorial on:
> http://docs.python.org/tutorial/index.html
> which was really good, but I have been an R user for 7 years and and am
> finding it difficult to do even basic things in python, for example I want
> to import my data
kitty wrote:
I'm new to python and I have read through the tutorial on:
http://docs.python.org/tutorial/index.html
which was really good, but I have been an R user for 7 years and and am
finding it difficult to do even basic things in python, for example I want
to import my data (a tab-delimited
On 09/09/2011 06:44 AM, kitty wrote:
Hi,
I'm new to python and I have read through the tutorial on:
http://docs.python.org/tutorial/index.html
which was really good, but I have been an R user for 7 years and and am
finding it difficult to do even basic things in python, for example I want
to imp