numbers to matrix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manishgarg31199
    New Member
    • Nov 2014
    • 1

    numbers to matrix

    I have 2 files and i have to calulate mean of numbers stored in these files

    like :

    file 1: x y
    12.33 12.33
    23.44 344444

    file 2: x y
    122.33 344.55
    122.33 344.55

    add 00 location of file 1 to 00 location of file 2 and finding mean .

    so how can i approached it??
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Start by reading each file as in:
    Code:
    for filename in  filelist:
        # create file object
        f = open(filename, "r")
        data = f.read()
    You will then parse the data and store the result in a suitable object such as a list or dictionary.

    Comment

    Working...