About 95,900 results
Open links in new tab
  1. Time complexity of python set operations? - Stack Overflow

    What is the the time complexity of each of python's set operations in Big O notation? I am using Python's set type for an operation on a large number of items. I want to know how each …

  2. python - set operation on a list of elements - Stack Overflow

    Jun 23, 2018 · If I'm understanding correctly, you want the difference for each set and the union of the rest of the sets. I would use a loop and functools.reduce and operator.or_:

  3. Python Sets vs Lists - Stack Overflow

    A set object is an unordered collection of distinct hashable objects. It is commonly used to test membership, remove duplicates from a sequence, and compute mathematical operations such …

  4. How can I perform set operations on Python dictionaries?

    Jul 17, 2013 · 8 While it is incredibly useful to be able to do set operations between the keys of a dictionary, I often wish that I could perform the set operations on the dictionaries themselves. I …

  5. python - How do I add two sets? - Stack Overflow

    Apr 15, 2015 · c = a | b Sets are unordered sequences of unique values. a | b, or a.union(b), is the union of the two sets — i.e., a new set with all values found in either set. This is a class of …

  6. python - set difference for pandas - Stack Overflow

    Aug 12, 2013 · A simple pandas question: Is there a drop_duplicates() functionality to drop every row involved in the duplication? An equivalent question is the following: Does pandas have a …

  7. Python remove set from set - Stack Overflow

    According to my interpretation of Python 2.7.2 documentation for Built-In Types 5.7 Set Types, it should be possible to remove the elements of set A from set B by passing A to …

  8. Python's "in" set operator - Stack Overflow

    Jan 3, 2012 · I'm a little confused about the python in operator for sets. If I have a set s and some instance b, is it true that b in s means "is there some element x in s such that b == x is true"?

  9. python - What makes sets faster than lists? - Stack Overflow

    The python wiki says: "Membership testing with sets and dictionaries is much faster, O(1), than searching sequences, O(n). When testing "a in b", b should be a set or dictionary instead of a …

  10. Append values to a set in Python - Stack Overflow

    Aug 2, 2010 · Append values to a set in Python Asked 15 years, 4 months ago Modified 1 year, 1 month ago Viewed 827k times