You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the following code to read and parse the attached .inp and .rpt files:
model = swmmio.Model(inp_file_name)
elem_dict = {element: model.__getattribute__(element).geojson for element in element_types}
When running this code, I get the following error:
File "/home/jolson/.virtualenvs/rest-api/lib/python3.6/site-packages/swmmio/utils/dataframes.py", line 89, in dataframe_from_rpt
index_col=0, names=cols)
File "/home/jolson/.virtualenvs/rest-api/lib/python3.6/site-packages/pandas/io/parsers.py", line 686, in read_csv
return _read(filepath_or_buffer, kwds)
File "/home/jolson/.virtualenvs/rest-api/lib/python3.6/site-packages/pandas/io/parsers.py", line 458, in _read
data = parser.read(nrows)
File "/home/jolson/.virtualenvs/rest-api/lib/python3.6/site-packages/pandas/io/parsers.py", line 1186, in read
ret = self._engine.read(nrows)
File "/home/jolson/.virtualenvs/rest-api/lib/python3.6/site-packages/pandas/io/parsers.py", line 2186, in read
values = data.pop(self.index_col[i])
IndexError: list index out of range
It seems like the dataframe_from_rpt method has an issue parsing certain kinds of .rpt files. @jennwuu came up with some code to patch this and knows more about why it breaks.
I had to upload the files with a .txt extension to make GitHub happy.
This report section create errors in dataframe_from_rpt function
**********************
Node Surcharge Summary
**********************
No nodes were surcharged.
*********************
Node Flooding Summary
*********************
No nodes were flooded.
I am using the following code to read and parse the attached .inp and .rpt files:
When running this code, I get the following error:
It seems like the
dataframe_from_rpt
method has an issue parsing certain kinds of .rpt files. @jennwuu came up with some code to patch this and knows more about why it breaks.I had to upload the files with a .txt extension to make GitHub happy.
example.rpt.txt
example.inp.txt
The text was updated successfully, but these errors were encountered: