Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of -2
0 answers
63 views

Importing packages import json import random import numpy as np from nltk import word_tokenize, pos_tag from nltk.stem import WordNetLemmatizer, PorterStemmer from tensorflow.keras.models import ...
Score of -4
0 answers
139 views

I am implementing a 3-layer dense neural network from scratch using NumPy for a regression problem. I am not using TensorFlow, PyTorch, Keras, or any neural-network library because I want to ...
Score of 2
1 answer
149 views

Let's say I have a conditional calculation like this import numpy as np def foo(a, b, c): if a <= 0 or c == 0: return foo_special(a, b, c) return foo_normal(a, b, c) def ...
Score of -4
0 answers
65 views

I am learning NumPy slicing and I am confused about why this slice returns an empty array: import numpy as np array = np.array([ [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], ...
Score of -2
0 answers
131 views

I am facing some issues concerning memory error due to a huge array that is used in my code. Recently I found Dask Array as a possible solution to parallelize the tasks and be able to process the data....
Score of 1
2 answers
185 views

In a dataset that contains X and Y coordinates, I want to assign a value in a new column based on the (X,Y) pair in a given row. Imagine a data set that contains the red points shown in the image ...
Score of 1
2 answers
158 views

I am working with huge matrix of small numbers using numpy and getting the following error: MemoryError: Unable to allocate 9.72 TiB for an array with shape (3268760, 3268760) )data type uint8" ...
Score of 2
2 answers
293 views

I'm trying to change a pixel to red. However, when I run the code, the pixel remains unedited. Can you help? import cv2 as cv import os import matplotlib.pyplot as plt def readAndWriteImage(): ...
Score of 2
1 answer
181 views

I have large matrices that contain both real numbers and nan. I want to find the most efficient way to determine if a matrix contains only zeros and/or nan entries. If it does, the code should return ...
Score of 2
0 answers
356 views

Consider import numpy as np N = 2000 a = np.ones((N, 5*N), dtype=np.float64, order="C") for _ in range(1000): x = np.array2string(a[0], threshold=np.inf) and import numpy as np N = ...
Score of 3
1 answer
154 views

I am running into an issue where my dictionary is not picking up full strings attached to variables, but instead just the first letter. import numpy as np import random trials = 5 d = {'trial': np....
Score of 4
2 answers
190 views

I want to show the distribution of angle estimations using a boxplot. The problem is that angles wrap around (I chose +-180° as the wrapping point, but the same applies to 0/360°). Matplotlibs boxplot ...
Score of -1
1 answer
118 views

I am using Numpy's F2PY to compile some Fortran code for use in Python, and I am trying to test the performance of the F2PY-generated interface using the -DF2PY_REPORT_ATEXIT compilation flag. ...
Score of 2
0 answers
129 views

I'm a windows user. I want to install numpy/scipy using openBLAS threading via conda. If I make an environment like this name: test channels: - conda-forge dependencies: - python - pip - numpy ...
Score of 2
3 answers
185 views

I'm trying to calculate the quality property of a storage tank over time. The quality is the weighted average of the previous period's quality (weighted by closing stock balance) and the current ...

15 30 50 per page
1
2 3 4 5
7682