Answers for "python get last to items in array"

1

how to get the last value in a list python

your_list = ["apple", "orange", "grapes"]
last_value = your_list[-1]
Posted by: Guest on June-22-2020
1

how to get last element in numpy array

In [10]: arr = numpy.array([1,23,4,6,7,8])

In [11]: [(arr[i], arr[-i-1]) for i in range(len(arr) // 2)]
Out[11]: [(1, 8), (23, 7), (4, 6)]
Posted by: Guest on October-25-2020

Code answers related to "python get last to items in array"

Python Answers by Framework

Browse Popular Code Answers by Language