I have a list of tuples representing the points x, y. I also have a list of values ββfor each of these points. How to combine them into a list of lists (for example, one entry for each point [x, y, val]) or a list of tuples?
thank
You cannot add records to tuples, because tuples are immutable. But you can create a new list of lists:
new = [[x, y, val] for (x, y), val in zip(points, vals)]
Tuples are immutable; they cannot be changed. Convert it to a list, and then convert it back if you want (list ((a, b))).
Source: https://habr.com/ru/post/1733226/More articles:Automagic output fields in CakePHP? - crudInitializing Glassfish Singleton bean twice - javacan i use user.IsInRole without using membership? - asp.netCan you interrupt the established ownership procedure - setBig jasper report in Excel causes corrupted file - excelHelp create a unit test header for a test answer, in particular Cache-Control, in determining whether caching is disabled or not - cachingLayered tiled paint - javaRemove extra spaces from the string (in place) - cHow does font backup work on non-Windows OS? - c #css select all descendants (asterisks) of elements with class - cssAll Articles