Skip to content
Advertisement

How to make dotted line in a binary array

how to create the dotted line in the below NumPy array

JavaScript

bh=make_figure(b,’gh’)

requirement: how to convert element 1 into 0 with the step of two expected outputs is like I tried with a brute force algorithm, but I am not able to find the solution

enter image description here

output array looks like

JavaScript

for visual representation like making a dotted line

enter image description here

Advertisement

Answer

Here’s one way to find the minimum weight full path, then take the first point, skip two points, and repeat until the end of the path.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement