About 173,000 results
Open links in new tab
  1. list - How to have a set of sets in Python? - Stack Overflow

    To represent a set of sets, the inner sets must be frozenset objects for the reason that the elements of a set must be hashable (all of Python’s immutable built-in objects are hashable). …

  2. Use curly braces to initialize a Set in Python - Stack Overflow

    From Python 3 documentation (the same holds for python 2.7): Curly braces or the set() function can be used to create sets. Note: to create an empty set you have to use set(), not {}; the latter …

  3. How can I create a Set of Sets in Python? - Stack Overflow

    TypeError: unhashable type: 'set' Is it possible to have a set of sets in Python? I am dealing with a large collection of sets and I want to be able to not have to deal duplicate sets (a set B of sets …

  4. How to clone or copy a set in Python? - Stack Overflow

    Apr 21, 2014 · So a rule of thumb for replicating any of instance of the basic data structures in Python (lists, dict, set, frozenset, string): a2 = list(a) #a is a list b2 = set(b) #b is a set c2 = …

  5. python - Empty set literal? - Stack Overflow

    Apr 15, 2017 · By all means, please use set() to create an empty set. But, if you want to impress people, tell them that you can create an empty set using literals and * with Python >= 3.5 ( see …

  6. How to construct a set out of list items in python?

    to create a list from a set. Just note that the order of the elements in a list is generally lost when converting the list to a set since a set is inherently unordered. (One exception in CPython, …

  7. python - Create a set from a series in pandas - Stack Overflow

    some_series.unique() gives every unique item in the series = basically a set. Creating a set from a set is fast because you have no duplicates --> less items to work on --> less work to do --> …

  8. How to create conda environment with specific python version?

    Jun 22, 2019 · To create an environment named py33 with python 3.3.0, using the channel conda-forge and a list of packages: conda create -y --name py33 python==3.3.0 conda install -f -y -q - …

  9. Creating Set of objects of user defined class in python

    Jul 5, 2013 · Table is a set which is unordered list, which should not have duplicate objects. Help: is there any way in this set up I can add the object only when it's not in the table. python

  10. Creating a set filled with letters from the alphabet in python

    May 19, 2014 · python: How to create set out of unicode objects. 1. Create a dictionary where letters of the alphabet are ...

Refresh