title: cant calulate min/max/sum of column python
body: <p>my code can calculate the min/max/sum of each row in the file alpha.txt provided, but it cannot calculate min/max/sum by column.... Any ideas on how to do it would be helpful, Thanks!</p>
  
  <pre><code>def load_data():
  
      usrnput = input("Enter a filename ")
      my_list = [[float(i) for i in line.split(',')] for line in open(usrnput, "+r")]
  
  
      row = len(my_list)
      column = len(my_list[0])
  
      if row != column:
          print("invalid")
      else:
          pass
  
      count = 0
      for row in(my_list):
          count = count + 1
          print(count, row)
  
  
  
      secondc = input("Enter a number ")
      if secondc == '2':
        minimum(my_list)
      elif secondc =='3':
          maximum(my_list)
      elif secondc =='4':
          sum1(my_list)
  
  def minimum(my_list):
      pickaposition = input("Enter a row or column: ")
      if pickaposition == ('1'):
          print(min(my_list[0]))
      elif pickaposition == ('2'):
          print(min(my_list[1]))
      elif pickaposition == ('3'): 
          print(min(my_list[2]))
      elif pickaposition == ('4'):
          print(min(my_list[3]))
      elif pickaposition == ('5'):
          print(min(my_list[4]))
  
  
  def maximum(my_list):
      pickaposition = input("Enter a row or column: ")
      if pickaposition == ('1'):
          print(max(my_list[0]))
      elif pickaposition == ('2'):
          print(max(my_list[1]))
      elif pickaposition == ('3'): 
          print(max(my_list[2]))
      elif pickaposition == ('4'):
          print(max(my_list[3]))
      elif pickaposition == ('5'):
          print(max(my_list[4]))
  
  def sum1(my_list):
      pickaposition = input("Enter a row or column: ")
      if pickaposition == ('1'):
          print(sum(my_list[0]))
      elif pickaposition == ('2'):
          print(sum(my_list[1]))
      elif pickaposition == ('3'): 
          print(sum(my_list[2]))
      elif pickaposition == ('4'):
          print(sum(my_list[3]))
      elif pickaposition == ('5'):
          print(sum(my_list[4]))
  
  def main():
      print("""1 - Open and load from a file
  2 - Minimum
  3 - Maximum 
  4 - Sum 
  5 - Delete
  6 - Save
  7 - Save as (specify new file name)
  0 - Exit
  """)
      pick = input("Enter a number ")
  
      if pick == "1":
          load_data()
      else:
          pass
  
  
  
  
  
  main()
  </code></pre>
  
  <p>Also alpha.txt contains the data </p>
  
  <pre><code>5,4,2,3.2
  1,.2,4.4,8
  3,8,6.5,2
  3,2,1,5.3
  </code></pre>
  
  <p>i really need to assign variable A-Z based on column, but i do not know how i would do that either.</p>
  
  <p>here is a full sample run of my code to make it easier for you maybe.</p>
  
  <pre><code>1 - Open and load from a file
  2 - Minimum
  3 - Maximum 
  4 - Sum 
  5 - Delete
  6 - Save
  7 - Save as (specify new file name)
  0 - Exit
  
  Enter a number 1
  Enter a filename alpha.txt
  1 [5.0, 4.0, 2.0, 3.2]
  2 [1.0, 0.2, 4.4, 8.0]
  3 [3.0, 8.0, 6.5, 2.0]
  4 [3.0, 2.0, 1.0, 5.3]
  Enter a number 3
  Enter a row or column: 3
  8.0
  &gt;&gt;&gt; 
  </code></pre>