About 41,100,000 results
Open links in new tab
  1. Convert list to tuple in Python - Stack Overflow

    Have you assigned the name 'tuple' as a variable name? it should work fine. L is a list and we want to convert it to a tuple. L = [1, 2, 3] tuple (L) By invoking tuple, you convert the list (L) into a tuple. As …

  2. python - Getting one value from a tuple - Stack Overflow

    The main difference between tuples and lists is that tuples are immutable - you can't set the elements of a tuple to different values, or add or remove elements like you can from a list.

  3. How does tuple comparison work in Python? - Stack Overflow

    Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal (i.e. the first is greater or smaller than the second) then that's …

  4. python - What is a tuple useful for? - Stack Overflow

    Sep 9, 2014 · A tuple is a good way to pack multiple values into that cookie without having to define a separate class to contain them. I try to be judicious about this particular use, though.

  5. python - Expanding tuples into arguments - Stack Overflow

    myfun(*some_tuple) does exactly what you request. The * operator simply unpacks the tuple (or any iterable) and passes them as the positional arguments to the function. Read more about unpacking …

  6. How to easily initialize a list of Tuples? - Stack Overflow

    I love tuples. They allow you to quickly group relevant information together without having to write a struct or class for it. This is very useful while refactoring very localized code. Initializin...

  7. c# - How to name tuple properties? - Stack Overflow

    How and "could be" organized return from the method which returns tuple type with the name of parameters, as an example private static Tuple<string, string> methodTuple() { return new {N...

  8. Pandas convert dataframe to array of tuples - Stack Overflow

    I have manipulated some data using pandas and now I want to carry out a batch save back to the database. This requires me to convert the dataframe into an array of tuples, with each tuple correspon...

  9. c++ - How is std::tuple implemented? - Stack Overflow

    A tuple is typically implemented as a compile time linked-list. The code is a bit obfuscated through template-syntax, but following elements are normally present:

  10. python - List vs tuple, when to use each? - Stack Overflow

    Using a tuple instead of a list is like having an implied assert statement that this data is constant, and that special thought (and a specific function) is required to override that. Some tuples can be used as …