There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
Code for previous raw can also be easily rewritten with itertools
. Left as an exercise.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
Code for previous raw can also be easily rewritten with itertools
. Left as an exercise.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
Code for previous raw can also be easily rewritten with itertools
. Left as an exercise.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
Code for previous raw can also be easily rewritten with itertools
. Left as an exercise.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
Code for previous raw can also be easily rewritten with itertools
. Left as an exercise.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
There are some things, which can be improved.
For one, the weave
method can be rewritten using itertools
, see this SO post for examples.
The idea is to combine elements via iterators (with function similar to zip
- see izip_longest
), chain
and filter
out None
s, which were possibly added from missing counterparts.
Then, this pattern:
rows = []
for i in range(len(splits_bestand)):
rows += [CoordinateRow(splits_bestand[i].split())]
can be replaced with more compact comprehension:
rows = [CoordinateRow(sb.split()) for sb in splits_bestand]
Also, Python list has extend
method, which can be used directly in .extend
method, like: self.row.extend(row)
. Similarly for append
method. If you will need those at all after using itertools
.