About 19,600,000 results
Open links in new tab
  1. Python: list of lists - Stack Overflow

    The first, [:], is creating a slice (normally often used for getting just part of a list), which happens to contain the entire list, and thus is effectively a copy of the list. The second, list(), is using the actual …

  2. slice - How slicing in Python works - Stack Overflow

    The first way works for a list or a string; the second way only works for a list, because slice assignment isn't allowed for strings. Other than that I think the only difference is speed: it looks like it's a little …

  3. python - Access item in a list of lists - Stack Overflow

    Jul 19, 2014 · 67 If I have a list of lists and just want to manipulate an individual item in that list, how would I go about doing that? For example: List1 = [[10,13,17],[3,5,1],[13,11,12]] What if I want to take …

  4. How can I pass a list as a command-line argument with argparse?

    Don't use quotes on the command line 1 Don't use type=list, as it will return a list of lists This happens because under the hood argparse uses the value of type to coerce each individual given argument …

  5. How to group dataframe rows into list in pandas groupby

    Given a dataframe, I want to groupby the first column and get second column as lists in rows, so that a dataframe like: a b A 1 A 2 B 5 B 5 B 4 C 6 becomes A [1,2] B [5,5,4] C [6] How do I do this?

  6. Python list vs. array – when to use? - Stack Overflow

    Aug 17, 2022 · The list is the part of python's syntax so it doesn't need to be declared whereas you have to declare the array before using it. You can store values of different data-types in a list …

  7. Checking if any elements in one list are in another [duplicate]

    Apr 22, 2013 · The second action taken was to revert the accepted answer to its state before it was partway modified to address "determine if all elements in one list are in a second list".

  8. Most efficient way to find if a value exists within a C# List

    Apr 17, 2013 · In C# if I have a List of type bool. What is the fastest way to determine if the list contains a true value? I don’t need to know how many or where the true value is. I just need to know if one e...

  9. In Python, how do I index a list with another list?

    In Python, how do I index a list with another list? Asked 16 years, 4 months ago Modified 2 years, 9 months ago Viewed 285k times

  10. Find an item in a list by LINQ - Stack Overflow

    If we need to find an element from the list, then we can use the Find and FindAll extensions method, but there is a slight difference between them. Here is an example.