Skip to content

Commit c5df2bf

Browse files
authored
Fix for pandas version 3 (#3743)
1 parent 2691ff8 commit c5df2bf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

openmc/data/photon.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ def transitions(self, transitions):
203203
for subshell, df in transitions.items():
204204
cv.check_value('subshell', subshell, _SUBSHELLS)
205205
cv.check_type('transitions', df, pd.DataFrame)
206-
self._transitions = transitions
206+
self._transitions = {
207+
subshell: df.convert_dtypes() for subshell, df in transitions.items()
208+
}
207209

208210
@classmethod
209211
def from_ace(cls, ace):

openmc/tallies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ def get_pandas_dataframe(self, filters=True, nuclides=True, scores=True,
19821982

19831983
# Expand the columns into Pandas MultiIndices for readability
19841984
if pd.__version__ >= '0.16':
1985-
columns = copy.deepcopy(df.columns.values)
1985+
columns = copy.deepcopy(list(df.columns.values))
19861986

19871987
# Convert all elements in columns list to tuples
19881988
for i, column in enumerate(columns):

0 commit comments

Comments
 (0)