title: How to mutate a namedtuple?
body: <p>I have a list of namedtuples. I want to mutate some of the values inside, however a tuple of course is immutable. I wonder if I can replace the entire tuple, but first I need to understand its struture, which I haven't found in the documentation. </p>
  
  <pre><code>def _createRowClass(self):
      self.Row = namedtuple('Row', [str(c) for c in self._columns])
  #_columns is a dict.
  
  def addRow(self, *args, **kwargs):
      self._rows.append(self.Row(*args, **kwargs))
  </code></pre>
  
  <p>An example element of _rows:</p>
  
  <pre><code>Out[40]: Row(rlnCoordinateX='1951.892292', rlnCoordinateY='1482.277896', rlnHelicalTubeID='6', rlnAngleTiltPrior='90.000000', rlnAnglePsiPrior='-110.29072', rlnHelicalTrackLength='1264.598540', rlnAnglePsiFlipRatio='0.500000', rlnImageName='000243@Extract/job011/Movies/Microtubules_02563.mrcs', rlnMicrographName='MotionCorr/job003/Movies/Microtubules_02563.mrc', rlnMagnification='10000.000000', rlnDetectorPixelSize='5.480000', rlnCtfMaxResolution='5.830000', rlnCtfFigureOfMerit='0.124704', rlnVoltage='300.000000', rlnDefocusU='7457.819824', rlnDefocusV='6964.129883', rlnDefocusAngle='33.520000', rlnSphericalAberration='2.700000', rlnCtfBfactor='0.000000', rlnCtfScalefactor='1.000000', rlnPhaseShift='0.000000', rlnAmplitudeContrast='0.100000', rlnOriginX='0.000000', rlnOriginY='0.000000')
  </code></pre>
  
  <p>When I index the namedtuple I get the value, but not the key, so what is this exactly: rlnAmplitudeContrast='0.100000'? </p>
  
  <p>I'm thinking maybe recreate this namedtuple with the changes I want, like replace rlnVoltage to 200,000000 instead of 300,000000 then replace this namedtuple in the list with the new mutated one? How can I do that? </p>
  
  <p>Any other suggestions and ideas are appreciated. </p>