# Error arising from using openmc.Tally.get\_pandas\_dataframe()

**URL:** <https://openmc.discourse.group/t/error-arising-from-using-openmc-tally-get-pandas-dataframe/6360>\
**Category:** User Support\
**Created:** [June 11, 2026, 2:13pm UTC](https://openmc.discourse.group/t/error-arising-from-using-openmc-tally-get-pandas-dataframe/6360 "2026-06-11T14:13:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doriangaboo](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@doriangaboo](https://openmc.discourse.group/u/doriangaboo)\
**Post date:** [June 11, 2026, 2:13pm UTC](https://openmc.discourse.group/t/error-arising-from-using-openmc-tally-get-pandas-dataframe/6360/1 "2026-06-11T14:13:52Z")

</div>

Hi all,

I recently had to do a clean reinstall of my system and for the most part everything seems to be working as expected, however previous Python analysis scripts now break when I try to use a line of code as below:

> fuelTally = sp.get\_tally(name = ‘FuelCell’)  
> fuelFlux = fuelTally.get\_slice(scores=[‘flux’])  
> fuelFluxDF = fuelFlux.get\_pandas\_dataframe()

I get the following error, the entire error message is pasted below

> ValueError: setting an array element with a sequence.

I am using anaconda and I had just built it using the base instructions that are provided in the OpenMC documentation for building your conda environment, which is what I thought I did last time but clearly something has changed. Hopefully someone has seen this same error and knows how to fix it.

I’m not sure if there’s some package that needs to be updated to make this work? It’s not particularly troublesome but it would be nice if I could use the dataframe format for the tally analysis. I have found a work around for the mean time.

Much appreciated.

Here is the entire error message

> * * *
> 
> ValueError Traceback (most recent call last)  
> Cell In[17], line 3  
> 1 # key = ‘energy high [eV]’  
> 2 key = ‘energy low [eV]’  
> ----\> 3 fuelFluxDF = fuelFlux.get\_pandas\_dataframe()  
> 4 fuelFluxSpectrumNorm = fuelFluxDF[‘mean’].to\_numpy()  
> 5 fuelFluxSpectrumNRGs = fuelFluxDF[‘energy high [eV]’].to\_numpy()  
> 6 # —
> 
> File ~/anaconda3/envs/openmcENDF7\_1/lib/python3.13/site-packages/openmc/tallies.py:1992, in Tally.get\_pandas\_dataframe(self, filters, nuclides, scores, derivative, paths, float\_format)  
> 1990 for i, column in enumerate(columns):  
> 1991 if not isinstance(column, tuple):  
> → 1992 columns[i] = (column,)  
> 1994 # Make each tuple the same length  
> 1995 max\_len\_column = len(max(columns, key=len))
> 
> File ~/anaconda3/envs/openmcENDF7\_1/lib/python3.13/site-packages/pandas/core/arrays/string\_.py:871, in StringArray.\_\_setitem\_\_(self, key, value)  
> 869 scalar\_value = lib.is\_scalar(value)  
> 870 if scalar\_key and not scalar\_value:  
> → 871 raise ValueError(“setting an array element with a sequence.”)  
> 873 if not scalar\_value:  
> 874 if value.dtype == self.dtype:
> 
> ValueError: setting an array element with a sequence.

---

<div class="post-metadata">

**Author:** ![LewisM23](https://avatars.discourse-cdn.com/v4/letter/l/ecd19e/32.png) [@LewisM23](https://openmc.discourse.group/u/LewisM23)\
**Post date:** [June 11, 2026, 3:59pm UTC](https://openmc.discourse.group/t/error-arising-from-using-openmc-tally-get-pandas-dataframe/6360/2 "2026-06-11T15:59:33Z")

</div>

I believe this is the bug caused by the newer pandas version, it has been resolved on the develop branch. [pull request #3743](https://github.com/openmc-dev/openmc/pull/3743)

---

<div class="post-metadata">

**Author:** ![doriangaboo](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@doriangaboo](https://openmc.discourse.group/u/doriangaboo)\
**Post date:** [June 14, 2026, 6:53pm UTC](https://openmc.discourse.group/t/error-arising-from-using-openmc-tally-get-pandas-dataframe/6360/3 "2026-06-14T18:53:54Z")

</div>

Much appreciated, thank you!
