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
When loading AnnualRunMeter.csv into a pandas dataframe for post-processing energy modeling results, I tried to index a column titled Electricity:HVAC J
Printing out column titles by executing meter_df.columns revealed that the issue is caused by a typo in the dataframe column header specifically for Electricity:HVAC [J] (Hourly). There is an erroneous extra space after the parentheses closing "Hourly" and the end of the string. This seems to be a problem with E+ output reporting code because I did not modify the meter.csv at all before loading it into the pandas dataframe, and the error occurs for multiple separate E+ runs. I don't know if this error is occurring for the last meter variable in the meter.csv file, or specifically for the Electricity:HVAC variable.
Workarounds for users are manually changing the title of the meter column in the csv or other post-processing tool.
Validate that a fix is complete by opening meter.csv and confirming the typo no longer appears.
When opening issues, it's always much appreciated if you can provide an IDF to reproduce (ideally a minimum complete verifiable example (MCVE)). That avoids us having to guess how we can trigger the same conditions.
Anyways, I tested with 5ZoneAirCooled.idf. The issue is just that ReadVarsEso is adding an extra space at the end of each line in the eplusout.csv.
You do not get that problem if instead of relying on ReadVarsEso you use the newer OutputControl:Files
I'm tempted to say just "Won't fix". ReadVarsEso is a historical fortran utility, replaced with a native C++ capability (OutputControl:Files), and you can easily work around it if you need to anyways.
df=pd.read_csv('eplusout.csv')
df.columns=df.columns.str.strip() # ReadVarsEso straps an extra space at the end of the line
Or even just do it once and for all in text mode before reading it
Issue overview
When loading AnnualRunMeter.csv into a pandas dataframe for post-processing energy modeling results, I tried to index a column titled Electricity:HVAC J
The following KeyError was thrown.
Printing out column titles by executing meter_df.columns revealed that the issue is caused by a typo in the dataframe column header specifically for Electricity:HVAC [J] (Hourly). There is an erroneous extra space after the parentheses closing "Hourly" and the end of the string. This seems to be a problem with E+ output reporting code because I did not modify the meter.csv at all before loading it into the pandas dataframe, and the error occurs for multiple separate E+ runs. I don't know if this error is occurring for the last meter variable in the meter.csv file, or specifically for the Electricity:HVAC variable.
Workarounds for users are manually changing the title of the meter column in the csv or other post-processing tool.
Validate that a fix is complete by opening meter.csv and confirming the typo no longer appears.
Details
Operating System: 64-bit operating system, x64-based processor
EnergyPlus v23.2.0
The text was updated successfully, but these errors were encountered: