By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,272 Members | 1,733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,272 IT Pros & Developers. It's quick & easy.

Array/List: how to find in which column the minimum value is?

P: 20
hi,

i used min() to find the minimum value of an array/list. it gives the min value of each row. But how do i know in which column does the min value is..?

a=[[0 for i in range(3)]for j in range(4)]
a[0]=[23,5,10]
a[1]=[11,34,12]
a[2]=[29,16,34]
a[3]=[53,35,13]

min(a[0])=5
min(a[1])=11
min(a[2])=16
min(a[3])=13
Oct 5 '10 #1
Share this Question
Share on Google+
1 Reply


100+
P: 332
Something like a[0].index(min(a[0]))
Oct 5 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.