Top "Iterable-unpacking" questions

A Python feature in which elements of an iterable are simultaneously assigned to multiple variables, e.g. a, b, c = [1, 2, 3].

What does the star operator mean, in a function call?

What does the * operator mean in Python, such as in code like zip(*x) or f(**k)? How is it …

python syntax parameter-passing iterable-unpacking argument-unpacking
How can I convert a dictionary into a list of tuples?

If I have a dictionary like: { 'a': 1, 'b': 2, 'c': 3 } How can I convert it to this? [ ('a', 1), ('b', 2), ('c', 3) ] And …

python list compatibility iterable-unpacking
Split tuple items to separate variables

I have tuple in Python that looks like this: tuple = ('sparkbrowser.com', 0, 'http://facebook.com/sparkbrowser', 'Facebook') and I wanna …

python tuples iterable-unpacking
"unpacking" a tuple to call a matching function pointer

I'm trying to store in a std::tuple a varying number of values, which will later be used as arguments …

c++ function-pointers c++11 variadic-templates iterable-unpacking
pandas apply function that returns multiple values to rows in pandas dataframe

I have a dataframe with a timeindex and 3 columns containing the coordinates of a 3D vector: x y z ts 2014…

python pandas dataframe apply iterable-unpacking
Django - How to do tuple unpacking in a template 'for' loop

In my views.py, I'm building a list of two-tuples, where the second item in the tuple is another list, …

python django templates tuples iterable-unpacking
How to extract dictionary single key-value pair in variables

I have only a single key-value pair in a dictionary. I want to assign key to one variable and it's …

python python-2.7 dictionary iterable-unpacking
Is it possible to return two lists from a function in python

I am new to python programming and need your help for the following: I want to return two lists from …

python python-2.7 iterable-unpacking
Getting only element from a single-element list in Python?

When a Python list is known to always contain a single item, is there a way to access it other …

python python-3.x python-2.7 list iterable-unpacking
How do I convert a tuple of tuples to a one-dimensional list using list comprehension?

I have a tuple of tuples - for example: tupleOfTuples = ((1, 2), (3, 4), (5,)) I want to convert this into a flat, one-dimensional list …

python tuples list-comprehension iterable-unpacking