Skip to main content

Questions tagged [numpy]

NumPy is one of the many modules in Python that adds support of large multidimensional arrays and matrixes, along with a large library of high-level mathematical functions for operations with these arrays.

0 votes
0 answers
9 views

Lattice-boltzmann simulation runs over the object mask, simulating areas that should be just black

I'm trying to simulate a tesla valve using the method, starting from this code. The problem is that the mask, the boundaries or the bounce-back are not being applied correctly. If I reverse the ...
yous's user avatar
  • 1
0 votes
0 answers
15 views

sharex and imshow do not produce plots of the same width

Context: I have the x,y and x,z projection of an image. I want the two images to be stacked vertically sharing the same width. My trial: I tried the following: import numpy as np import matplotlib....
Antonio Ragagnin's user avatar
0 votes
1 answer
28 views

Pandas apply is turning matrices into nan/None

I am running the following code on a dataset trying to tally the rows from one data set that match a varied set of criteria. I am using the apply function to store this tally inside of a matrix, where ...
Shand Seiffert's user avatar
0 votes
0 answers
17 views

How to interpolate a 2D Scatter plot in python

I have the following problem: I am working with ultrasonic data from a sector scan. An example is shown in the following: From the file I am reading I receive a 2D array. One dimension is the phase ...
mzr97's user avatar
  • 69
-1 votes
0 answers
32 views

How to solve Process finished with exit code -1073741819 (0xC0000005) in Python? [closed]

I am using Python 3.8 in Pycharm. I have Windows 10 and wanted to reproduce this publicly available code: #!/usr/bin/env python # -*- encoding: utf-8 -*- import sys sys.setrecursionlimit(4000) import ...
Idkwhatywantmed's user avatar
1 vote
1 answer
17 views

Jax vs numpy for generating Heston paths

I have this python code (from QuantPy) which generates stock paths under the Heston model using numpy. I am trying to convert it to using Jax. For some reason, the numpy version runs in about 2 ...
gd1234's user avatar
  • 23
0 votes
1 answer
43 views

How to combine type hint using bound type variable and static types for maximum flexibility?

I would like to add type hints to a simple function. Since it internally only uses numpy calls, it is very flexible with its inputs. Basically, it accepts all array-like objects, for which there is ...
ti-sch's user avatar
  • 1
-2 votes
0 answers
14 views

i am in the process of using pandasai, but keep getting this error from pandas.compat import is_numpy_dev as _is_numpy_dev

from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i am running numpy version 2 python version 3.11 pandas 1....
user3537234's user avatar
2 votes
2 answers
33 views

Dictionary indexing with Numpy/Jax

I'm writing an interpolation routine and have a dictionary which stores the function values at the fitting points. Ideally, the dictionary keys would be 2D Numpy arrays of the fitting point ...
LordCat's user avatar
  • 482
-4 votes
1 answer
61 views

Python numpy, math: Any way raising a negative number to a decimal power without resulting in Nan?

I am getting errors trying to raise a negative number to a decimal power. For example, I want to calculate this (-2)^(4.8) which should result in valid, real number output (27.85 from my TI-89). I ...
westcoasting__'s user avatar
-3 votes
0 answers
14 views

Deep learning problem for boundary detections [closed]

import numpy as np #Reference: https://stackoverflow.com/questions/55890813/how-to-fix-object-arrays-cannot-be-loaded-when-allow-pickle-false-for-imdb-loa np_load_old = np.load # modify the default ...
Renuka Prasad's user avatar
0 votes
0 answers
20 views

numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject error

I am trying to import pmdarima but it gives the error ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject I uninstalled numpy ...
Eyram's user avatar
  • 1
0 votes
1 answer
44 views

Issue with Custom Rounding Function in Python Pandas

I have implemented a custom rounding function in Python using Pandas, but it's not producing the expected results in certain cases. It basically should always round down to the nearest step.Here's the ...
arrabattapp man's user avatar
-3 votes
0 answers
20 views

how can I compute the striking force of a football player using python [closed]

in a football match between England and Spain Julius Fueke needs a decisive goal, write a Python program that can compute the striking force of each of the players i tried using the import numpy but ...
yagi's user avatar
  • 1
0 votes
0 answers
18 views

How to "average out" multiple curves with sklearn Lasso regression?

The lecture slides here: https://www.cs.cmu.edu/~ggordon/10725-F12/slides/09-acceleration.pdf on page show multiple lines on a convergence plot apparently "averaged out" with Lasso ...
ufghd34's user avatar
  • 151

15 30 50 per page
1
2 3 4 5
7631