Is there any pythonic way to find average of specific tuple elements in array?

Is there any pythonic way to find average of specific tuple elements in array?

I want to write this code as pythonic. My real array much bigger than this example.

I want to write this code as pythonic. My real array much bigger than this example.

( 5+10+20+3+2 ) / 5

print(np.mean(array,key=lambda x:x[1])) TypeError: mean() got an unexpected keyword argument 'key'
array = [('a', 5) , ('b', 10), ('c', 20), ('d', 3), ('e', 2)]

sum = 0 for i in range(len(array)): sum = sum + array[i][1]

average = sum / len(array) print(average)

import numpy as np print(np.mean(array,key=lambda x:x[1]))

How can avoid this? I want to use second example.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...

Python GUI Programming Projects using Tkinter and Python 3

Python GUI Programming Projects using Tkinter and Python 3

Guide to Python Programming Language

Guide to Python Programming Language