title: pyspark substring and aggregation
body: <p>I am new to Spark and I've got a csv file with such data:</p>
  
  <pre><code>date,            accidents, injured
  2015/20/03 18:00    15,          5
  2015/20/03 18:30    25,          4
  2015/20/03 21:10    14,          7
  2015/20/02 21:00    15,          6
  </code></pre>
  
  <p>I would like to aggregate this data by a specific hour of when it has happened. My idea is to Substring date to 'year/month/day hh' with no minutes so I can make it a key. I wanted to give average of accidents and injured by each hour. Maybe there is a different, smarter way with pyspark?</p>
  
  <p>Thanks guys!</p>