Forwarding to python-tutor.
-- Forwarded message --
From: Carmel O'Shannessy
Date: Thu, Sep 11, 2014 at 12:18 PM
Subject: Re: [Tutor] python qn
To: Danny Yoo
thanks,
this worked:
times2 = [float(i) for i in times[:2]]
On Thu, Sep 11, 2014 at 1:10 PM, Danny Yoo wrote:
>
> On
Juan Christian wrote:
> On Thu, Sep 11, 2014 at 5:23 PM, Peter Otten <__pete...@web.de> wrote:
>>
>>
>> You are getting an *encoding* error, so this may be triggered when you
>> are trying to print. Can you post the traceback?
>>
>> Also, what is your OS and what does
>>
>> $ python3 -c'import loc
On Thu, Sep 11, 2014 at 5:23 PM, Peter Otten <__pete...@web.de> wrote:
>
>
> You are getting an *encoding* error, so this may be triggered when you are
> trying to print. Can you post the traceback?
>
> Also, what is your OS and what does
>
> $ python3 -c'import locale; print(locale.getpreferredenc
Juan Christian wrote:
> On Thu, Sep 11, 2014 at 4:39 PM, Juan Christian
> wrote:
>>
>> Using 3.4.1
>>
>> I did try:
>>
>> self.persona_name = unicode(personaname)
>> self.persona_name = personaname.decode("utf-8")
>>
>> But didn't work!
>>
>
>
> Some of the chars that brakes the program:
>
> \
On Thu, Sep 11, 2014 at 4:39 PM, Juan Christian
wrote:
>
> Using 3.4.1
>
> I did try:
>
> self.persona_name = unicode(personaname)
> self.persona_name = personaname.decode("utf-8")
>
> But didn't work!
>
Some of the chars that brakes the program:
\u0183
\u2020
\u0361
\u0649
And many others cra
Forget to tell, sorry. I'm using Python 3.4.1
On Thu, Sep 11, 2014 at 3:53 PM, Sebastian Silva
wrote:
> Hi,
> Python 2 suffers from these kinds of issues frequently.
>
> However Python 3 does not.
>
> Now, to deal with different encodings in Python 2 you need to cast to
> unicode type, and then
I'm iterating through Steam users and friend lists.
So, my program was working good, but then I got some UnicodeEncodeError
randomly, I didn't know where was the problem, then I was checking the
names that I got from the API by hand, and then I saw users with ™, ︻デ═一,
︻芫, º³® and tons of other
Done. thanks guys.
On Thu, Sep 11, 2014 at 2:43 PM, Danny Yoo wrote:
> > On Thu, Sep 11, 2014 at 2:09 PM, Peter Otten <__pete...@web.de> wrote:
> >>
> >>
> >> You can explode the list by invoking the function with
> >>
> >> fetch_users(*my_list) # prepend the list with a star
> >>
> >> but I rec
> On Thu, Sep 11, 2014 at 2:09 PM, Peter Otten <__pete...@web.de> wrote:
>>
>>
>> You can explode the list by invoking the function with
>>
>> fetch_users(*my_list) # prepend the list with a star
>>
>> but I recommend that you change the function's signature to
>>
>> def fetch_users(steamids):
>>
On Thu, Sep 11, 2014 at 2:07 PM, Danny Yoo wrote:
>
>
> Hi Juan,
>
> You have a "var-arity" function called fetch_users(), and you'd like
> to apply it with an explicit list of arguments "my_list".
>
> In this case, you want to use the application operator:
>
>
> https://docs.python.org/2/tutorial
Carmel O'Shannessy wrote:
> times = ['50.319468', '50.319468', 't1']
>
> I want to convert [0:2] to floats.
>
> I tried:
>
> float.times = [float(i) for i in times[:2]]
>
> but get the error msg:
>
> TypeError: can't set attributes of built-in/extension type 'float'
Try
times[:2] = [floa
On Thu, Sep 11, 2014 at 8:08 AM, Carmel O'Shannessy wrote:
>
> Hello,
>
> times = ['50.319468', '50.319468', 't1']
>
> I want to convert [0:2] to floats.
>
> I tried:
>
> float.times = [float(i) for i in times[:2]]
Hi Carmel,
Do you intend to have a variable named "float.times" here on the le
Juan Christian wrote:
> Let's say I have the following list: my_list = ['76561198048214059',
> '76561198065852182', '76561198067017670', '76561198077080978',
> '76561198077257977', '7656119807971
> 7745', '76561198088368223', '76561198144945778']
>
> and I have a function with the following signa
On Thu, Sep 11, 2014 at 9:42 AM, Juan Christian
wrote:
> Let's say I have the following list: my_list = ['76561198048214059',
> '76561198065852182', '76561198067017670', '76561198077080978',
> '76561198077257977', '7656119807971
> 7745', '76561198088368223', '76561198144945778']
>
> and I have a f
Hello,
times = ['50.319468', '50.319468', 't1']
I want to convert [0:2] to floats.
I tried:
float.times = [float(i) for i in times[:2]]
but get the error msg:
TypeError: can't set attributes of built-in/extension type 'float'
Carmel
--
--
Carmel O'Shannessy, Assoc. Prof.
Department of
Let's say I have the following list: my_list = ['76561198048214059',
'76561198065852182', '76561198067017670', '76561198077080978',
'76561198077257977', '7656119807971
7745', '76561198088368223', '76561198144945778']
and I have a function with the following signature: def
fetch_users(*steamids)
U
On 9/11/2014 6:34 AM, Radhika Gaonkar wrote:
I have an implementation of lsa, that I need to modify. I am having some
trouble understanding the code. This is the line where I am stuck:
DocsPerWord = sum(asarray(self.A > 0, 'i'), axis=1)
Python doesn't provide an axis parameter for the sum buil
> I've just again experienced a new employer that tells my students my
> name is 'Van Den Broek' when I tell them that it is 'van den Broek.'
> This is the third time this week I've encountered this as a
> programming example. Perhaps the use of the example is responsible for
> the false belief amo
Radhika Gaonkar wrote:
> I have an implementation of lsa, that I need to modify. I am having some
> trouble understanding the code. This is the line where I am stuck:
>
> DocsPerWord = sum(asarray(self.A > 0, 'i'), axis=1)
>
> The link for this implementation is :
> http://www.puffinwarellc.com/
Thanks for the suggestion and corrections.
I don't put the else staement onf if log_file but now I realize my mistake
I have 3 comand to do:
step_1_out =["STAR --genomeDir /home/sbsuser/databases/Starhg19/GenomeDir/ --
runMode alignReads --readFilesIn %s %s --runThreadN 12 --readFilesCommand
z
I have an implementation of lsa, that I need to modify. I am having some
trouble understanding the code. This is the line where I am stuck:
DocsPerWord = sum(asarray(self.A > 0, 'i'), axis=1)
The link for this implementation is :
http://www.puffinwarellc.com/index.php/news-and-articles/articles/3
On 7 September 2014 21:01, Danny Yoo wrote:
> Let's use a concrete example: say that we'd like to make sure a
> Person's name is always capitalized. We might try to enforce this
> capitalization property in the constructor.
Hi all,
I've just again experienced a new employer that tells my
22 matches
Mail list logo