close
Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
5 replies
89 views

I have an array with almost infinite dimensions. I would like to iterate it from top left to bottom right, and when a certain threshold is reached iteration can be stoped. I create our test array. mat ...
user1491229's user avatar
Advice
0 votes
4 replies
112 views

#Multiple Layers import numpy as np class NeuralNetwork: def __init__(self, input_size, hiddenLayerSizes, output_size): self.input_size = input_size self.hiddenLayerSizes = ...
mbh16_x's user avatar
2 votes
0 answers
84 views

I need to refer to the base attribute of arrays to keep track of whether I am currently handling some view of it or the base array itself. However, if I dump the array to a file with dill and load it ...
Joce's user avatar
  • 2,244
0 votes
1 answer
75 views

As explained in this answer it is possible to save an instance of a class and load it again using numpy save/load routines. However, if I do this with a derived class, I lose the reference to the ...
Joce's user avatar
  • 2,244
0 votes
1 answer
69 views

im struggle with an error when creating MRE. why these code : from pandas import DataFrame as df import numpy as np from sklearn.neighbors import NearestNeighbors as nrb from sklearn.decomposition ...
Fia Shofia Zahra's user avatar
2 votes
1 answer
139 views

Suppose I have two integer numpy vectors a0 and a1 of the same length. I want to return unique pairs of elements of a0 and a1. For instance: a0 = np.asarray([0, 1, 4, 1, 0, 4]) # --> b0 = np....
Ben's user avatar
  • 679
1 vote
2 answers
193 views

I am trying to reformat the values in a dataframe column for a person's height from, for example, 5'8" to 5 Feet 8 Inches and I figure that I can at least replace the apostrophe and double quotes ...
Lord Bobbymort's user avatar
1 vote
1 answer
101 views

i want find 2d index(from PCA). based on pivot_table vector at my custom metric. fastly. that's why im using KDTree. but because it, these error is occur: ValueError Traceback (most recent call last) ...
Fia Shofia Zahra's user avatar
Best practices
1 vote
13 replies
180 views

import math import matplotlib.pyplot as plt import numpy as np m=50 def taylor_cos(x,n): sum=0 for i in range(0, n): sum=sum+ (((-1)**i) * (x**(2*i)) / math.factorial(2*i)) ...
Artemii Karapetian's user avatar
1 vote
1 answer
191 views

I am working on a code that calculates the 2D FFT of a function as a first step. I am testing it with the function exp(-r)/r, with r=sqrt(x²+y²) which has the analytical Hankel transform of 1/sqrt(r²+...
cyanmess's user avatar
Best practices
0 votes
6 replies
94 views

I have a pandas series of a bunch of 32 bit integers, and I'd like to roll through with series.rolling and get the bitwise-and of all the values in the window, basically trying to do this except that ...
Pitt's user avatar
  • 1
Advice
0 votes
2 replies
136 views

I’m a beginner learning NumPy and Data Science. I understand basic operations such as array creation, indexing, slicing, and simple computations. However, when I try to follow tutorials that use NumPy ...
GAURANG UDGIRKAR's user avatar
Best practices
0 votes
4 replies
126 views

I have a multigraph class in Python that is used as a base for simple undirected, unlooped graphs. I wrote my own graph6 parser based on the advice in the SO post. NetworkX implements it in a similar ...
n3trunner's user avatar
Advice
0 votes
2 replies
105 views

I've got a class project to do, it's supposed to display the mandelbrot set with a customizable colour map and a max_iter slider. I've got the colour map radio buttons working, but I can't manage the ...
Helewapo's user avatar
-5 votes
2 answers
205 views

I have a "deeply nested" NumPy array like this: array = [ [ [ [ "data . . . "], ] ], [ ...
Guy Eric Matz's user avatar

15 30 50 per page
1
2 3 4 5
7684