You can take a look at the documentation for pm.set_data() for some examples. Does that get you what you need?
pm.set_data()