Skip to content

Commit

Permalink
loadnpy: do not slice the same object twice (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 authored Nov 22, 2023
1 parent 113aba3 commit 484e050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smoderp2d/tools/save_load_data_nopickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def loadunicode(self):
return n[0]

def loadnpy(self):

n = len(self.lines[2:])
rows = self.lines[2:]
n = len(rows)
m = len(self.lines[2].split(';'))
type_ = self.lines[1]
arr = np.zeros([n, m], float)
Expand All @@ -98,7 +98,7 @@ def loadnpy(self):
if 'float' in type_:
self.npyel = self.__float

for i, line in enumerate(self.lines[2:]):
for i, line in enumerate(rows):
for j, el in enumerate(line.split(';')):
arr[i, j] = self.npyel(el)

Expand Down

0 comments on commit 484e050

Please sign in to comment.