Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'column': 0.07; 'subject:file': 0.07; 'rows': 0.09; 'python': 0.11; 'columns': 0.16; 'files)': 0.16; 'skip:n 90': 0.16; 'subject:arithmetic': 0.16; 'all,': 0.19; 'advance.': 0.19; 'subject:/': 0.26; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'file': 0.32; 'text': 0.33; 'could': 0.34; 'received:google.com': 0.35; 'thank': 0.38; 'follows:': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'simple': 0.61; 'first': 0.61; 'dear': 0.65; 'below:': 0.68; '(10': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=iodyPZxUxW56mILOA7RVne8U4C/PIsQ5sCGg55rmF9I=; b=PSwM2AeV+lTi7yoMQGRVXJv2zH+7dsbwLdFPp690DE91WLRIAxfLi6KeRM6oXPJc2K ZUgx8D0x8XdKkwN7FvnJsAzSDAJ8GNHiqgBh7gRLMuK00TYmTXtRTcExR4fs9WEww6ab YWLLRT4oP/Utq+KVyr+9s9nW1hAhURzx3xdashADYP41PLJSNllFbhFCbU+Cr+sAZwrD Jl0D2lc7pUyTWjT5LbbRtg3lgXgDjquRHW5U8gXaBuPej/78eza4mE1R+MvUDHvRXXtp 8kRK5ZXLToMTQgnA1zLS6aDyxyJcqdjozo3kZhXbgmCqjVDJ1hHzl/uh6RxAo8Sib5gM fhZw== X-Received: by 10.43.91.73 with SMTP id bl9mr6829403icc.17.1369239219893; Wed, 22 May 2013 09:13:39 -0700 (PDT) MIME-Version: 1.0 From: Keira Wilson Date: Thu, 23 May 2013 01:13:19 +0900 Subject: file I/O and arithmetic calculation To: python-list@python.org Content-Type: multipart/alternative; boundary=bcaec51866dc507b3004dd50d952 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 116 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369239228 news.xs4all.nl 15880 [2001:888:2000:d::a6]:52687 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45741 --bcaec51866dc507b3004dd50d952 Content-Type: text/plain; charset=ISO-8859-1 Dear all, I would appreciate if someone could write a simple python code for the purpose below: I have five text files each of 10 columns by 10 rows as follows: file_one = 'C:/test/1.txt' file_two = 'C:/test/2.txt' . . . file_five = 'C:/test/5.txt' I want to calculate the mean of first row (10 elements) for each file (5 files), if mean of first column (10 elements) of each file (5 files) is 50. Thank you in advance. Keira --bcaec51866dc507b3004dd50d952 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Dear all,

I would appreciate if someone could write a simple python code for the purp= ose below:

I have five text files each of 10 columns by 10 rows as follows:


fi=
le_one =3D 'C:/test/1.txt'
file_two =3D 'C:/test/2.txt'=20
. . .=20
file_five =3D 'C:/test/5.txt'

I want to calculate the mean o= f first row (10 elements) for each file (5 files), if mean of first column = (10 elements) of each file=A0(5 files)=A0is 50.

Thank you in advance.

Keira


--bcaec51866dc507b3004dd50d952--