Skip to content

Commit

Permalink
Replace .iteritems with .items for new pandas
Browse files Browse the repository at this point in the history
Pandas is depreciating .iteritems with .items in version 2.0
  • Loading branch information
chazeon committed Oct 18, 2023
1 parent 6bfbaa4 commit 662a8a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cij/util/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def fill_cij(
a = []
b = []

for sym, col in elast.iteritems():
for sym, col in elast.items():
sym = sym.lower() # Warning: user may use upper case "Cij" instead of "cij"!
if not re.search(r"c(\d)(\d)", sym): continue
_a = numpy.zeros(nsym)
Expand Down Expand Up @@ -124,7 +124,7 @@ def fill_cij(

# drop empty columns

for index, col in list(elast.iteritems()):
for index, col in list(elast.items()):
if numpy.allclose(col.to_numpy(), 0, atol=drop_atol):
elast = elast.drop(index, axis=1)

Expand Down

0 comments on commit 662a8a1

Please sign in to comment.