Categories
Mastering Development

What is required to make this treemap plot work?

Been trying to get treemap to work but the output is blank and not sure why. If I take an example from the web and place it into my code the the output works fine – but when I try to use my data it does not output. The sample code is.. library(plotly) labels = […]

Categories
Mastering Development

Connection Algorithm with Constraints

I have block categories A, B, C, … and each category has blocks. all blocks in each category have ports p0, p1, p2, … and have constraints to connect as: A: a0, a1, a2, … p0: B, C p1: B p2: B, C p3: C B: b0, b1, b2, … p0: A C: c0, c1, […]

Categories
Mastering Development

Python calls the same function in a loop, and uses the return value of the last call as the parameter of this call

This is kmeans I wrote. I want to call this function cyclically to repeatedly calculate the distance to the center point and enter the return as parameter the first input is (b[0,:],b[1,:]) def DIV(point1,point2): plt.figure() c = [] d = [] for i in range(1000): dist1 = np.linalg.norm(Z[i] – point1) dist2 = np.linalg.norm(Z[i] – point2) […]

Categories
Database Development

Sum Scores in Tree Structure Based on Rollup Type

I am trying to calculate totals for each node of a tree structure, Calculating the total depends on roll up type I have Structure like below if node type is current list = Look to current node, no need I go down in the tree if node type is child = ignore the current node […]

Categories
Mastering Development

how to reduce the noise of an image on python?

This is my code so far. I am totally lost and not sure what to do. its python language. I cant use cv2 or matpolibic. I am only allowed to use cimpl and numpy from Cimpl import* import numpy as np def reduce_noise (image: Image) -> Image: new_image = copy(image) for pixel in image: X, […]

Categories
Ask Electrical Engineering Engineering

How can I make Verilog HDL ModelSim test bench for a simple ripple adder circuit output an addition table instead of a long list of every calculation?

I’ve completed my assignment and I’d like to make the output look something like this, with one table for sum output and one table for carry output: Sum: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 __ __ __ __ __ __ __ __ __ __ __ __ […]

Categories
Mastering Development

How to change CSV values into multiple limited columns in Postgres?

I have a table with a single column in a Postgres 13.1 database. It consists of many rows with comma-separated values – around 20 elements currently. I want to split the data into multiple columns. But I have only a limited number of columns say 5 and more than 5 CSV values in a single […]

Categories
Ask Geographic Information System (GIS)

Image Segmentation and Classification with Google Earth Engine

I’m new to using Google Earth Engine and I obtained the following code from Medium and tried to update it with the AOI and training data for my specific area. I am trying to classify landcover for an AOI and then export this to csv using CORINE landuse categories The issue seems to be with […]

Categories
Ask Geographic Information System (GIS)

Arcpy.Merge_data_managment

The code example contains layers with the same name inside a gdb file. Here’s how to combine layers of the same name with arcpy. But you need a code that the layers in this gdb will come from the user every time. There will be no parcel each time. The input will be different import […]

Categories
Mastering Development

Fast shaping of multiprocessing return values in Python

I have a function with list valued return values that I’m multiprocessing in Python and I need to concatenate them to 1D lists at the end. The following is a sample code for demonstration: import numpy as np import multiprocessing as mp import random as rd N = 4 L = list(range(0, N)) def F(x): […]