# Reading StatePoint file using python shows ntaxError: Invalid character 'e' in expression ERROR.

**URL:** https://openmc.discourse.group/t/reading-statepoint-file-using-python-shows-ntaxerror-invalid-character-e-in-expression-error/547
**Category:** User Support
**Created:** [February 12, 2020, 9:37am UTC](https://openmc.discourse.group/t/reading-statepoint-file-using-python-shows-ntaxerror-invalid-character-e-in-expression-error/547 "2020-02-12T09:37:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shabudarda](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shabudarda/32/497_2.png) [@shabudarda](https://openmc.discourse.group/u/shabudarda)
#### Post date: [February 12, 2020, 9:37am UTC](https://openmc.discourse.group/t/reading-statepoint-file-using-python-shows-ntaxerror-invalid-character-e-in-expression-error/547/1 "2020-02-12T09:37:26Z")

</div>

I am trying to access a statepoint file and using python and extracting the data to excel file. Below is the code. I am getting an error. the error is also shown below. SyntaxError: Invalid character ‘e’ in expression. Can anyone help me solve the issue? Thanks.

import openmc

sp1 = openmc.StatePoint(‘statepoint.100.h5’)

tally1 = sp1.tallies[1]  
tally2 = sp1.tallies[2]  
tally3 = sp1.tallies[3]  
flux1 = tally1.mean.ravel()  
flux2 = tally2.mean.ravel()  
flux3 = tally3.mean.ravel()  
import pandas as pd  
df1 = pd.DataFrame (flux1)  
df2 = pd.DataFrame (flux2)  
df3 = pd.DataFrame (flux3)  
filepath1 = ‘1.xlsx’  
filepath2 = ‘2.xlsx’  
filepath3 = ‘3.xlsx’  
df1.to\_excel(filepath1, index=False)  
df2.to\_excel(filepath2, index=False)  
df3.to\_excel(filepath3, index=False)

Traceback (most recent call last):

File “”, line 1, in

File “/opt/anaconda3/lib/python3.7/site-packages/openmc/statepoint.py”, line 141, in **init**

su = openmc.Summary(path\_summary)

File “/opt/anaconda3/lib/python3.7/site-packages/openmc/summary.py”, line 60, in **init**

self.\_read\_geometry()

File “/opt/anaconda3/lib/python3.7/site-packages/openmc/summary.py”, line 107, in \_read\_geometry

cell\_fills = self.\_read\_cells()

File “/opt/anaconda3/lib/python3.7/site-packages/openmc/summary.py”, line 168, in \_read\_cells

cell.region = Region.from\_expression(region, self.\_fast\_surfaces)

File “/opt/anaconda3/lib/python3.7/site-packages/openmc/region.py”, line 125, in from\_expression

.format(expression[i]))

SyntaxError: Invalid character ‘e’ in expression

---

<div class="post-metadata">

### Author: ![shabudarda](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shabudarda/32/497_2.png) [@shabudarda](https://openmc.discourse.group/u/shabudarda)
#### Post date: [February 12, 2020, 9:39pm UTC](https://openmc.discourse.group/t/reading-statepoint-file-using-python-shows-ntaxerror-invalid-character-e-in-expression-error/547/2 "2020-02-12T21:39:51Z")

</div>

Hello, Anyone tried accessing the statepoint file using Python 3.7.6 and Openmc 0.11.0? This line sp=openmc.StatePoint(‘statepoint.60.h5’) is having the problem, SyntaxError: Invalid character ‘e’ in expression

Please let me know if anyone solved it. Thanks.

---

<div class="post-metadata">

### Author: ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)
#### Post date: [February 17, 2020, 1:30pm UTC](https://openmc.discourse.group/t/reading-statepoint-file-using-python-shows-ntaxerror-invalid-character-e-in-expression-error/547/3 "2020-02-17T13:30:04Z")

</div>

Hi Sharif,

It appears that the behavior you’re encountering is due to a bug in OpenMC. Until we get it fixed, the way you can get around this for now is to ensure that no surfaces in your geometry have IDs greater than 999,999.

Best,  
Paul
