Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get average list in 2d array

import numpy as np
a = [[1,2],[3,4]]
np.mean(a) # (1+2+3+4)/4 = 2.5
np.mean(a, axis=0) # [mean(1,3), mean(2,4)] = [2.0, 3.0]
np.mean(a, axis=1) # [mean(1,2), mean(3,4)] = [1.5, 2.5]
Comment

PREVIOUS NEXT
Code Example
Python :: download from radio javan python 
Python :: orderd dictionary pop vs del 
Python :: hotel room allocation tool in python 
Python :: SQL Query to Join Two Tables Based Off Closest Timestamp 
Python :: gonad 
Python :: how to find index of an element in list in python stackoverflow 
Python :: numpy multiply by inverse square root of value 
Python :: flask give port number 
Python :: access last element of list python 
Python :: auto-py-to-exe with python3 
Python :: Right click context menu of a file in Python 
Python :: create a response object in python 
Python :: bs4 find element by id 
Python :: python pickle save and load multiple variables 
Python :: sheebang python 
Python :: how to print text after an interger 
Python :: user input dictionary python 
Python :: merge multiple csv files into one dataframe python 
Python :: function to convert minutes to hours and minutes python 
Python :: python zip lists into dictionary 
Python :: OneID flask 
Python :: how to use tensorboard 
Python :: python expression factorisation 
Python :: random choice dictionary python 
Python :: generate valid sudoku board python 
Python :: how to change dtype object to int 
Python :: installing fastapi 
Python :: confusion matrix heat map 
Python :: Python program to check leap year or not? 
Python :: print a to z in python 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =