mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Merge pull request #929 from paulromano/pandas-fix
Fix pandas issue related to MultiIndex conversion
This commit is contained in:
commit
0beb4cb937
2 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
2
setup.py
2
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue