Skip to content

Rahul0211/066-array-with-ones-zeroes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Write a Python program to create a 2d array with 1 on the border and 0 inside using Numpy.

Sample Output:

Original array:

[[ 1. 1. 1. 1. 1.] [ 1. 1. 1. 1. 1.] [ 1. 1. 1. 1. 1.] [ 1. 1. 1. 1. 1.] [ 1. 1. 1. 1. 1.]]

1 on the border and 0 inside in the array

[[ 1. 1. 1. 1. 1.] [ 1. 0. 0. 0. 1.] [ 1. 0. 0. 0. 1.] [ 1. 0. 0. 0. 1.] [ 1. 1. 1. 1. 1.]]

Notes

  • Function should return array with 2d array with 1 on border and 0 inside.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%