title: Downsize series containing boolean data with resample
body: <p>I have a large time series dataframe containing numerical and boolean data in separate columns. I am trying to downsample the data from 1-min interval to 15-min interval. The boolean columns are system statuses and I am struggling with how to downsample them and still retain any faults. Currently, my resample uses <code>last</code> thus would overlook any system faults that occur on any row but the last. </p>
  
  <p>What I would like it to do: if 'fault' occurs on any row during the 15-min series, then the resulting timestamp after the resample would read 'fault' else would read 'ok'. </p>
  
  <p>I know the solution reside in <code>how=''</code> of resample, but because I am new to numpy and pandas I can't figure out what to use. </p>
  
  <p>My code:</p>
  
  <pre><code>import pandas as pd
  
  # Reads .csv, combines Date and Time columns into Timestamp, sets Timestamp as index
  df = pd.read_csv('data.csv', parse_dates = {'Timestamp' : ['Date', 'Time']}, index_col = 'Timestamp')
  
  # Fixing any incomplete data and interpolating any numerical gaps 
  index = pd.date_range(freq='1min', start=df.first_valid_index(), end=df.last_valid_index())
  df_clean = df.reindex(set(df.index).union(index))
  for col in df_clean:
      df_clean[col] = df_clean[col].interpolate('time').ix[index]
  
  # Downsampling numerical data 
  df_avg = df_clean.resample('15min', how='mean')
  
  # Downsampling boolean data separately 
  df_avg['alarm1']=df_clean['alarm1'].resample('15min', how='last')
  
  # Fix for missing index name
  df_avg.index.name = 'Timestamp'
  
  # Adding date and time columns back to dataframe
  df_avg.reset_index(level=0, inplace=True)
  df_avg['Date'] = df_avg['Timestamp'].apply(lambda x: x.strftime('%Y/%m/%d'))
  df_avg['Time'] = df_avg['Timestamp'].apply(lambda x: x.strftime('%H:%M:%S'))
  
  # Write new .csv 
  df_avg[['Date','Time','A','B','C','alarm1']].to_csv('out.csv', index=False)
  </code></pre>