About 31,500,000 results
Open links in new tab
  1. 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

  2. python - Understanding the set () function - Stack Overflow

    Mar 3, 2013 · Internally, the set type is implemented using a hash table: a hash function is used to separate items into a number of buckets to reduce the number of equality operations needed to …

  3. How do python Set Comprehensions work? - Stack Overflow

    Dec 10, 2013 · Q1 - Is the following a set() of a generator expression or a set comprehension? (Or are they same? If so, are list & dict comprehensions also corresponding type-cast on generators?) …

  4. Why don't Python sets preserve insertion order? - Stack Overflow

    Do the same efficiency improvements that led the Python team to change the dict implementation not apply to sets as well? I'm not looking for pointers to ordered-set implementations or ways to use dicts …

  5. Why is '+' not understood by Python sets? - Stack Overflow

    Oct 8, 2011 · 119 Python chose to use | instead of + because set union is a concept that is closely related to boolean disjunction; Bit vectors (which in python are just int / long) define this operation …

  6. Python: See if one set contains another entirely?

    For "multiset" see python - How to check if all items in a list are there in another list? - Stack Overflow .

  7. Python sets: difference() vs symmetric_difference() - Stack Overflow

    Jun 15, 2018 · What is the difference between difference() and symmetric_difference() methods in python sets?

  8. python - Returning boolean if set is empty - Stack Overflow

    I am struggling to find a more clean way of returning a boolean value if my set is empty at the end of my function I take the intersection of two sets, and want to return True or False based on if...

  9. python - How do I add the contents of an iterable to a set? - Stack ...

    Oct 28, 2010 · You can use the set () function to convert an iterable into a set, and then use standard set update operator (|=) to add the unique values from your new set into the existing one.

  10. python - Set MultiIndex of an existing DataFrame in pandas - Stack …

    Can I use set_idex to create a multiindex using tuples stores in one of the columns of the dataframe? Or do I have to (1) construct and assign a multiindex using pd.Multiindex.from_tuples(); and then (2) …