Python Forum
Please help in understanding this piece of code
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help in understanding this piece of code
#1
How this code
np.array([range(i, i + 3) for i in [2, 4, 6]])
results in
Output:
array([[2, 3, 4], [4, 5, 6], [6, 7, 8]])
Thanks
Reply


Messages In This Thread
Please help in understanding this piece of code - by tinkalgo - May-10-2018, 10:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with understanding the following code ClimbAddict 3 2,384 Oct-13-2019, 10:14 AM
Last Post: ClimbAddict

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020