title: Reorganizing repeated rows with one unique value into columns
body: <p>I've got a dataframe of chemical assay data that's formatted rather poorly. The convention is to have a single row containing the ID, spatial data, and other attribute data with the concentrations all following under columns for gold, silver, zinc, (their columns being labelled Au_PPM, Ag_PPM, Zn_PPM). However, this data set has separate rows for each element in sample, with all the other data being repeated.
  How can I merge duplicate rows that have the same sample ID and attribute info, but unique VALUE (eg. 0.4) and CHEM_UNIT columns (eg. Ag_PPM), where the CHEM UNIT becomes the column name, and the VALUES from each row populate the appropriate CHEM_UNIT column?
  Basically just trying to condense the repeated data into a single row.</p>
  <p>Sample from the df:</p>
  <pre><code>    SAMPLE_NO   SAMPLE_SOURCE   DH_DEPTH_FROM   DH_DEPTH_TO LONGITUDE_GDA2020   LATITUDE_GDA2020    VALUE   CHEM_UNIT
  0   3580567 A full face slice of core   575.0   577.0   136.692456  -28.878919  135.0   Ba_PPM
  1   3580567 A full face slice of core   575.0   577.0   136.692456  -28.878919  0.0 Ag_PPM
  2   3580567 A full face slice of core   575.0   577.0   136.692456  -28.878919  0.0 As_PPM
  3   3580567 A full face slice of core   575.0   577.0   136.692456  -28.878919  0.0 Au_PPM
  4   3580567 A full face slice of core   575.0   577.0   136.692456  -28.878919  2.5 Be_PPM
  </code></pre>
  <p>Any insight would be appreciated!</p>