It looks to me like you can use the _replace
method of a namedtuple to do this pretty easily:
PageNumList[0] = PageNumList[0]._replace(PicData='hello')
This puts a new namedtuple in your PageNumList
which looks pretty much like the old namedtuple except that we've changed the PicData
"attribute". You can't edit the namedtuple that you have already since namedtuple
s are immutable (just like their unnamed counterparts: tuples
)