About 93,000 results
Open links in new tab
  1. Making a 0 to n vector in python - Stack Overflow

    I am a new python user and I was wondering how I could make a 0 to n vector. I would like the user to be able to input an integer for n, and receive an output of [0,1,2,3,4,5...,n]. This is what …

  2. python - How to create a vector search index in Azure AI search …

    Dec 6, 2023 · I want to create an Azure AI Search index with a vector field using the currently latest version of azure-search-documents v11.4.0. Here is my code: from …

  3. python - How do I create an empty array and then append to it in …

    To create an empty multidimensional array in NumPy (e.g. a 2D array m*n to store your matrix), in case you don't know m how many rows you will append and don't care about the …

  4. How to declare array of zeros in python (or an array of a certain size)

    The question says "How to declare array of zeros ..." but then the sample code references the Python list: buckets = [] # this is a list However, if someone is actually wanting to initialize an …

  5. Create a zero vector of size n in Python - Stack Overflow

    Apr 13, 2018 · I would like to create a function of n. I would like the function to return a zero column vector of size n. To clarify if I choose n=3, in return I get: np.array[[0], [0],

  6. How to create an integer array in Python? - Stack Overflow

    Dec 7, 2009 · Also: as many others have noted including Pi and Ben James, this creates a list, not a Python array. While a list is in many cases sufficient and easy enough, for performance …

  7. python - How do I create a numpy array of all True or all False ...

    Jan 16, 2014 · Since True and False are represented in Python as 1 and 0, respectively, we have only to specify this array should be boolean using the optional dtype parameter and we are …

  8. How do I declare an array in Python? - Stack Overflow

    Oct 3, 2009 · A couple of contributions suggested that arrays in python are represented by lists. This is incorrect. Python has an independent implementation of array() in the standard library …

  9. Implementing 3D vectors in Python: numpy vs x,y,z fields

    Apr 22, 2017 · I am implementing a 3D Vector class in Python. My vector has coordinates x, y and z (all floats), and I need to decide how to store this information. I can see at least three options …

  10. python - Create numpy matrix filled with NaNs - Stack Overflow

    Oct 11, 2019 · $ python -mtimeit "import numpy as np; a = np.empty((100,100));" "a.fill(np.nan)" 10000 loops, best of 3: 54.3 usec per loop $ python -mtimeit "import numpy as np; a = …

Refresh