Crane Ugly wrote:
> I always try to have code that easy to read.
That's laudable, code is a means of communication.
> At least for myself.
and only for yourself, unfortunately.
Recommended read:
https://www.python.org/dev/peps/pep-0008/
--
https://mail.python.org/mailman/listinfo/python-l
It is nothing more but naming convention. This code was part of the function.
Actually, in the final version I removed that "f" and changed some names of
variables to shorter versions.
It is all about your own preferences towards readability of the code and
ability of visual capture of the code.
On Monday, November 23, 2015 at 12:58:49 PM UTC-8, Crane Ugly wrote:
> Thank you all.
> Here is the last piece of code that caused me so much troubles but now
> working the way I wanted it:
>
> fRawData = []
> with open(fStagingFile2) as fStagingFile2FH:
> fRawData = [l
Thank you all.
Here is the last piece of code that caused me so much troubles but now working
the way I wanted it:
fRawData = []
with open(fStagingFile2) as fStagingFile2FH:
fRawData = [line.strip() for line in
fStagingFile2FH.readlines()] # This is
On 11/21/2015 10:26 AM, BartC wrote:
On 21/11/2015 10:41, vostrus...@gmail.com wrote:
Hi,
I have a file with one parameter per line:
a1
b1
c1
a2
b2
c2
a3
b3
c3
...
The parameters are lines of characters (not numbers)
I need to load it to 2D array for further manipulations.
So far I managed to
On 21/11/2015 10:41, vostrus...@gmail.com wrote:
Hi,
I have a file with one parameter per line:
a1
b1
c1
a2
b2
c2
a3
b3
c3
...
The parameters are lines of characters (not numbers)
I need to load it to 2D array for further manipulations.
So far I managed to upload this file into 1D array:
Parame
In a message of Sat, 21 Nov 2015 15:22:55 +0100, Laura Creighton writes:
>At this point you might get a bit frustrated. Python is happily telling
>you that you don't have a newarray[0][0] which is hardly news to you who
>was trying to initialise the thing.
My bad. I was thinking about 2 dimentio
In Python we don't write while loops that often.
instead we do:
for i in range(NumberOfColumns):
for j in range(NumberOfRows):
do_something()
But for the particular case that you are after, constructing lists,
we have something even neater -- list comprehensions.
So you might write:
vostrus...@gmail.com wrote:
> Hi,
> I have a file with one parameter per line:
> a1
> b1
> c1
> a2
> b2
> c2
> a3
> b3
> c3
> ...
> The parameters are lines of characters (not numbers)
>
> I need to load it to 2D array for further manipulations.
> So far I managed to upload this file into 1D arra
Hi,
I have a file with one parameter per line:
a1
b1
c1
a2
b2
c2
a3
b3
c3
...
The parameters are lines of characters (not numbers)
I need to load it to 2D array for further manipulations.
So far I managed to upload this file into 1D array:
ParametersRaw = []
with open(file1) as fh:
Parameters
10 matches
Mail list logo