About 164,000 results
Open links in new tab
  1. How can I create a Set of Sets in Python? - Stack Overflow

    How can I create a Set of Sets in Python? Asked 14 years, 5 months ago Modified 2 years, 10 months ago Viewed 83k times

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

    Jun 22, 2019 · Is it possible to access with the commands python and ipython both python version 3.3.0 in that specific environment, i.e. not by setting an alias in the .bashrc?

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

    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 creates an empty dictionary, a data structure that we …

  4. 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 …

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

    Nov 27, 2016 · You can do my_set = set(my_list) or, in Python 3, my_set = {*my_list} to create a set from a list. Conversely, you can also do my_list = list(my_set) or, in Python 3, my_list = …

  6. How to create a venv with a different Python version

    Dec 20, 2021 · Simple and recent Supposed that you have a different version of Python installed in your system. To check use the following command to check: py --list Output: -3.10-64 * -3.7 …

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

    This is what I have tried but it brings a list of all the records instead of the set (sf is how I name the data frame). a=set(sf['Status']) print a According to this webpage, this should work. How to …

  8. How do I create a Python set with only one element?

    Aug 12, 2015 · The set() builtin expects an iterable type argument. In python, strings can be treated as iterable objects where each character is an element. Attempting to create a …

  9. python - Converting a list to a set changes element order - Stack …

    Mar 21, 2012 · The abstract concept of a set does not enforce order, so the implementation is not required to. When you create a set from a list, Python has the liberty to change the order of the …

  10. Initialising an array of fixed size in Python - Stack Overflow

    Why don't these questions get answered with the obvious answer? a = numpy.empty(n, dtype=object) This creates an array of length n that can store objects. It can't be resized or …