diff --git a/openmc/tallies.py b/openmc/tallies.py index 76c6fa7141..977aed5e5f 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1664,8 +1664,10 @@ class Tally(IDManagerMixin): new_column.extend(['']*delta_len) columns[i] = tuple(new_column) - # Create and set a MultiIndex for the DataFrame's columns - df.columns = pd.MultiIndex.from_tuples(columns) + # Create and set a MultiIndex for the DataFrame's columns, but only + # if any column actually is multi-level (e.g., a mesh filter) + if any(len(c) > 1 for c in columns): + df.columns = pd.MultiIndex.from_tuples(columns) # Modify the df.to_string method so that it prints formatted strings. # Credit to http://stackoverflow.com/users/3657742/chrisb for this trick diff --git a/setup.py b/setup.py index 2f85bc3a3b..338fe5fec8 100755 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ kwargs = { # Required dependencies 'install_requires': [ 'six', 'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib', - 'pandas<0.21.0', 'lxml', 'uncertainties' + 'pandas', 'lxml', 'uncertainties' ], # Optional dependencies