Kent Johnson wrote:
> Dave Kuhlman wrote:
>> On Tue, Oct 23, 2007 at 10:10:24PM -0400, Kent Johnson wrote:
>>
>> [snip]
>>
>>> Perhaps I was a bit hasty.
>>>
>>> Lists are implemented as arrays of references. I believe they are
>>> - amortized O(1) for append - occasionally the list must be realloc
Dave Kuhlman wrote:
> On Tue, Oct 23, 2007 at 10:10:24PM -0400, Kent Johnson wrote:
>
> [snip]
>
>> Perhaps I was a bit hasty.
>>
>> Lists are implemented as arrays of references. I believe they are
>> - amortized O(1) for append - occasionally the list must be reallocated
>> and copied
>
> OK.
On Tue, Oct 23, 2007 at 10:10:24PM -0400, Kent Johnson wrote:
[snip]
>
> Perhaps I was a bit hasty.
>
> Lists are implemented as arrays of references. I believe they are
> - amortized O(1) for append - occasionally the list must be reallocated
> and copied
OK. I'm groping here. Wikipedia tel
Ricardo Aráoz wrote:
> Kent Johnson wrote:
>> Use list when you want a sequence of items indexed by sequential integers.
>> Lists
>> - preserve order
>> - are fast for indexed lookup
>> - are relatively slow (O(n)) for adding, deleting and searching (though
>> for small lists this should not be a
Kent Johnson wrote:
> Bryan Fodness wrote:
>> Thank you. This works well. I am still trying to figure out the pros
>> and cons of using an array, dictionary or list.
>
> Array is specialized, you probably want list or dict.
>
> Use list when you want a sequence of items indexed by sequential i
Bryan Fodness wrote:
> Thank you. This works well. I am still trying to figure out the pros
> and cons of using an array, dictionary or list.
Array is specialized, you probably want list or dict.
Use list when you want a sequence of items indexed by sequential integers.
Lists
- preserve order
Thank you. This works well. I am still trying to figure out the pros and
cons of using an array, dictionary or list.
On 10/22/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Bryan Fodness wrote:
> > Here is the actual snippet of code
> >
> >
> > calc_depth =8.1 # which is actually d
>> Here is the actual snippet of code
>>
>>
>> calc_depth =8.1 # which is actually d
>> unblockedFS = 13.4 # which is the indexed fs
>>
>> for line in file('21Ex6MV_tmr.dat'):
>> d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10, fs11, fs12,
>> fs13, fs14, fs15, fs16, fs17,
Bryan Fodness wrote:
> Here is the actual snippet of code
>
>
> calc_depth =8.1 # which is actually d
> unblockedFS = 13.4 # which is the indexed fs
>
> for line in file('21Ex6MV_tmr.dat'):
> d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10, fs11, fs12,
> fs13, fs14,
On 10/21/07, Bryan Fodness <[EMAIL PROTECTED]> wrote:
>
>
> I want to get a variable name dependent on another variable. I have
> tried,
>
> 'fs' + str(int(round(unblockedFS))) for fs13
>
> and I get an invalid literal. If I code in the fs13, everything works. Is
> it possible to do this?
>
>
>
>
Here is the actual snippet of code
calc_depth =8.1 # which is actually d
unblockedFS = 13.4 # which is the indexed fs
for line in file('21Ex6MV_tmr.dat'):
d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10, fs11, fs12, fs13,
fs14, fs15, fs16, fs17, fs18, fs19, fs20, fs21,
"Bryan Fodness" <[EMAIL PROTECTED]> wrote
>I want to get a variable name dependent on another variable.
Thats usually a bad idea, but...
> I have tried,
>
> 'fs' + str(int(round(unblockedFS))) for fs13
I have no idea what you think this will do.
It gives a syntax error for me, which is what I e
I want to get a variable name dependent on another variable. I have tried,
'fs' + str(int(round(unblockedFS))) for fs13
and I get an invalid literal. If I code in the fs13, everything works. Is
it possible to do this?
unblockedFS=13.4
for line in file('21Ex6MV_tmr.dat'):
d, fs1, fs2, fs
13 matches
Mail list logo