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
Stu Rocksan wrote:
class Complex:
def _init_(self, realpart, imagpart)
Special methods in Python have TWO underscores at the beginning and end.
You need to call it __init__ rather than _init_.
Also, are you aware that Python already includes a built-in complex type?
>>> comp
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 (a tab-delimited .txt file)
On 2011/09/09 12:10 PM, Stu Rocksan wrote:
I have a very basic question that I am sure has a simple answer. I
would be very appreciative of anyone that would set me straight.
Python 2.7.2
I am simply trying to pass arguments. Based on the documentation that
I've read so far _init_() is called
I have a very basic question that I am sure has a simple answer. I
would be very appreciative of anyone that would set me straight.
Python 2.7.2
I am simply trying to pass arguments. Based on the documentation that
I've read so far _init_() is called upon instance creation and the
arguments are
On Thu, 8 Sep 2011 21:39:47 -0500
"Ryan Strunk" wrote:
> By the time I write this all into a file, the end user will never
> even know this crazy hierarchy exists, but I will, and I don't like
> it. Do I just need to get over it and realize that sometimes nested
> is necessary, or is there a bett
12 matches
Mail list logo