Skip to content

Tag: numpy

grid with circular distances python

I have a 2d grid of dim q(rows) p(columns). The element of the grid are the indices of the element itself. So the element a[i,j]=(i,j). Now I need to create pair-wise distances between these points with circularity constraint, meaning that the element distance(a[i,p-1],a[i,0])=1 (I am using 0-index based matr…

How to sort aggregated numpy array?

My first post on stackoverflow + am very new to programming. Apologies in advance for any poor formatting and missing information. :) I aggregated two columns in a csv file (one column of seller names, the other of transactional amounts) to find how much each seller has made in total: I want to sort it in des…

Cumulatively merge rows with the same index

In python pandas, I have a dataframe which looks something like this: Some of the dates are repeated, with a different count value. I would like to merge these values into one row like this: If it’s any help the data source is a CSV file. There is likely a way to do this in a for loop but I

Conformal plotting python

I’m working on the joukowsky transformation for plotting airfoils and I’m trying to do so with python. The conformal mapping should be pretty straight forward but can’t seem to find a guide on how to approach the problem on python. by the math: According to the theory, by plotting z i should…

How to Install Numpy in PyPy on Windows

I want to install Numpy on PyPy on windows but I cannot. Here is my errors: Answer You don’t have any compiler on your system, so PyPy can’t compile the packages. notice the line error: Microsoft Visual C++ 14.0 is required. Get it with “Build Tools for Visual Studio”: https://visualst…