FILTER RESULTS FOR OCCUPIED HOURS ONLY

Enhanced results viewer giving access to airflow visualizations, shaded variable display and wind rose.
User avatar
JohnM
Site Admin
Site Admin
Posts: 56
Joined: Tue Jun 12, 2012 4:00 pm
Location: IES Head Office, Glasgow, UK
Contact:

Re: FILTER RESULTS FOR OCCUPIED HOURS ONLY

Post by JohnM »

If you can use Python, then install a library called pandas.

The following script will do the job for you.

Code: Select all

import pandas as pd

# Setup values
ifilename = 'C:/path/to/the/input.csv'
ofilename = 'C:/path/to/the/output.csv'

# Read the csv file into a dataframe
dfI = pd.read_csv(ifilename, encoding='latin_1', header=None, mangle_dupe_cols=False, skipinitialspace=True)

# Extract headers into a transposed dataframe
dfH = dfI.ix[2:,0:3].T

# Extract values into a transposed dataframe
dfV = dfI.ix[:,4:].T

# Combine the dataframes into the final output dataframe
dfO = pd.concat([dfH,dfV])

# Write the dataframe to a csv file
dfO.to_csv(ofilename, encoding='latin_1', header=False, index=False)
Just modify the csv file paths and you're good to go.

Example output can be found here.

I hope this helps. :)
IES Software Development
btysoe
VE Graduate
VE Graduate
Posts: 86
Joined: Fri Mar 01, 2013 9:39 am

Re: FILTER RESULTS FOR OCCUPIED HOURS ONLY

Post by btysoe »

Thanks I'll give it a go.
Post Reply