Skip to content
murmot

Results for “python numpy array example program code pdf site:discuss.python.org”

  • discuss.python.org

    How to change numpy arrays in a function and return the values?

    I’m writing code which does matrix operations in functions and I’m using numpy arrays to store my matrices.Here are two simple Python codes, the first successfully multiplies 2 matrices together and passes the matrix back to the calling code.

  • discuss.python.org

    numpy array access - Python Help - Discussions on Python.org

    May 18, 2023 · A [:] = B [:]+C [:] The slicing of B and C in Numpy creates view objects, not separate arrays. This is different from built-in lists, where slicing will create a new list. These view objects conceptually represent a sub-section of the original array without copying any data; when you index (or re-slice) them, they use math to figure out the corresponding index in the original array. So, there ...

  • discuss.python.org

    Problem with the numpy module - Discussions on Python.org

    Mar 22, 2024 · Python Help klander (Kent Anderson) March 22, 2024, 3:15am 1 I’m Kent Anderson, learning python for the first time. I was attempting to practice a sample with numpy, and ran into these problems.

  • discuss.python.org

    How to get an extension module working w/ free threading?

    For example SymPy can use python-flint under the hood transparently. Users don’t need to know what is happening except that you can install python-flint to “make SymPy faster”. In this context when you use SymPy’s public API everything is automatically thread-safe without caveats.

  • discuss.python.org

    Add a `__len__` and `__getitem__` ABC to `collections.a...

    The example from the ticket: ```… python import numpy as np import random random.sample(np.array([1,2,3]),1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user1/py33/lib/python3.3/random.py", line 298...

  • discuss.python.org

    Numpy is not working - Python Help - Discussions on Python.org

    Jan 26, 2024 · Hi, you might have the same problem another user had about ~two weeks ago. The issue arises when downloading a new module into the search path of a different Python version. For example, if you are using Python v3.12 but numpy was downloaded into your v3.8, then you will run into this issue.

  • discuss.python.org

    Idea: Allow assigning a scalar to all elements of a list slice, just as is...

    It is easy to assign the same scalar value to every element of a slice of a numpy array, but not so easy for a python list: somenparray[start::step]=42 Doing that to a slice of python list requires specifying how many elements are in the slice: somelist[start::step]=lenslice*[42] # You have.

  • discuss.python.org

    Convert PDF into TXT - Discussions on Python.org

    Apr 12, 2023 · Good day community, I’m trying to compile some code to convert PDF to text, but the result is not what I expected. I have tried different libraries such as pytesseract, pdfminer, pdftotext, pdf2image, and OpenCV, but all of them extract the text incompletely or with errors. The last two codes that I used are these: CODIGO 1 import pytesseract from pdf2image import convert_from_path ...

  • discuss.python.org

    Using multiprocessing to convert files to pdf - Python Help ...

    Jun 11, 2023 · Hi Python community, I have some experience with Python and don’t consider myself a complete beginner. However, this is my first time to use multiprocessing. I have watched two videos about using multiprocessing in Python. I have written a script to convert all xlsx files from one folder to pdf files and save them to other folder. Conversion process is done with soffice (libreoffice command ...