Question
so i have a list of lists [[0,1,2.333],[0,2,2.333],[0,7.89,2.333],[1,4.3,2.333],[1,5.7,2.333],[1,4.2,2.333],[2,53.4,2.333],[3,5,2.333],[3,4.22,2.333],[4,3.4,2.333],[4,6.7,2.333],[5,3,2.333],[6,2.3,2.333]] for every item in the list that's first number is 0 i want to get the mean
so i have a list of lists
[[0,1,2.333],[0,2,2.333],[0,7.89,2.333],[1,4.3,2.333],[1,5.7,2.333],[1,4.2,2.333],[2,53.4,2.333],[3,5,2.333],[3,4.22,2.333],[4,3.4,2.333],[4,6.7,2.333],[5,3,2.333],[6,2.3,2.333]]
for every item in the list that's first number is 0 i want to get the mean of the second digit. so for all the lists that begin in 0 i need to add the second numbers(1,2,7.89), and divide it by the number of lists that begin in 0.
i want to do this with every beginning digit(0,1,2,3,4,5,6)
and put the averages of the second digit in a list.
how can i do this in python?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started