SlideShare a Scribd company logo
1 of 1
Download to read offline
^quickmean.py
^datanums.txt
^ this is the csvsplit.py file
to or greater than 100 . 3. For the quickmean.py script modify the script to average 20 random
selected numbers instead of al the data from datanums.txt.4! /usr/bin/env python # -*_ coding: utf-
8 _*_ expects one number per line FileName="datanums.txt" Total =0 Number =0 NumberList =[]
for Item in Reader: NumberList. append(float(Item)) #print (NumberList) Total = Total + float(Item)
Number = Number +1 Reader.close() print (NumberList) print ("The mean of %d values was %.2f"
% (Number, Total/Number)) Line 1/23 Column: 1 Character 35(023) Encoding: 1252 (ANSI-La#1
/usr/bin/env python #-*-coding; utf-8 -*- ."split file and create a list FileName - "datasplit.txt" import
csv # open the FileName for reading and parse with # the CSV reader function # Default is comas,
give "excel-tab" for tabs. Eielditer = csv.reader (open(FileName, ' r '), dialect - "excel-tab') # Using
list comprehension to parse at once # could also do a for loop # This creates a list of lists Fields =
[Row for Row in Fielditer] print (Flelds)

More Related Content

Similar to quickmeanpy datanumstxt this is the csvsplitpy file .pdf

#include iostream #include cstring #include vector #i.pdf
 #include iostream #include cstring #include vector #i.pdf #include iostream #include cstring #include vector #i.pdf
#include iostream #include cstring #include vector #i.pdf
anandatalapatra
ย 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
ssuser6254411
ย 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
faithxdunce63732
ย 
Program 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdfProgram 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdf
ezhilvizhiyan
ย 
2.overview of c++ ________lecture2
2.overview of c++  ________lecture22.overview of c++  ________lecture2
2.overview of c++ ________lecture2
Warui Maina
ย 
File handling in c++
File handling in c++File handling in c++
File handling in c++
Daniel Nyagechi
ย 
Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential files
CIS321
ย 
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
Yashpatel821746
ย 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdf
stopgolook
ย 
UNIT III PYTHON.pptx python basic ppt ppt
UNIT III PYTHON.pptx python basic ppt pptUNIT III PYTHON.pptx python basic ppt ppt
UNIT III PYTHON.pptx python basic ppt ppt
SuganthiDPSGRKCW
ย 

Similar to quickmeanpy datanumstxt this is the csvsplitpy file .pdf (20)

C Programming Project
C Programming ProjectC Programming Project
C Programming Project
ย 
Aggregate.pptx
Aggregate.pptxAggregate.pptx
Aggregate.pptx
ย 
Write the C++ code for a function getInput which will read in an unkno.docx
Write the C++ code for a function getInput which will read in an unkno.docxWrite the C++ code for a function getInput which will read in an unkno.docx
Write the C++ code for a function getInput which will read in an unkno.docx
ย 
#include iostream #include cstring #include vector #i.pdf
 #include iostream #include cstring #include vector #i.pdf #include iostream #include cstring #include vector #i.pdf
#include iostream #include cstring #include vector #i.pdf
ย 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
ย 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
ย 
Program 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdfProgram 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdf
ย 
FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.
FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.
FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.
ย 
Devry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-filesDevry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-files
ย 
Devry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-filesDevry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-files
ย 
2.overview of c++ ________lecture2
2.overview of c++  ________lecture22.overview of c++  ________lecture2
2.overview of c++ ________lecture2
ย 
File handling in c++
File handling in c++File handling in c++
File handling in c++
ย 
Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential files
ย 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
ย 
8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...
8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...
8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...
ย 
Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...
Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...
Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...
ย 
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
ย 
Hooking signals and dumping the callstack
Hooking signals and dumping the callstackHooking signals and dumping the callstack
Hooking signals and dumping the callstack
ย 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdf
ย 
UNIT III PYTHON.pptx python basic ppt ppt
UNIT III PYTHON.pptx python basic ppt pptUNIT III PYTHON.pptx python basic ppt ppt
UNIT III PYTHON.pptx python basic ppt ppt
ย 

More from adamswatch

Queue Class Write a Queue class using doublylinked structu.pdf
Queue Class Write a Queue class using doublylinked structu.pdfQueue Class Write a Queue class using doublylinked structu.pdf
Queue Class Write a Queue class using doublylinked structu.pdf
adamswatch
ย 
Questions 912 A study was conducted testing whether memory.pdf
Questions 912 A study was conducted testing whether memory.pdfQuestions 912 A study was conducted testing whether memory.pdf
Questions 912 A study was conducted testing whether memory.pdf
adamswatch
ย 

More from adamswatch (20)

quoctua 7p78s 1 fill in the Ponent square in I seure 2m.pdf
quoctua 7p78s  1 fill in the Ponent square in I seure 2m.pdfquoctua 7p78s  1 fill in the Ponent square in I seure 2m.pdf
quoctua 7p78s 1 fill in the Ponent square in I seure 2m.pdf
ย 
ractice Test Unit 7 8 Old World vultures are birds that ha.pdf
ractice Test Unit 7 8 Old World vultures are birds that ha.pdfractice Test Unit 7 8 Old World vultures are birds that ha.pdf
ractice Test Unit 7 8 Old World vultures are birds that ha.pdf
ย 
Rachel Hutchisson ile Kurumsal Sosyal Sorumluluk a Sona Er.pdf
Rachel Hutchisson ile Kurumsal Sosyal Sorumluluk a Sona Er.pdfRachel Hutchisson ile Kurumsal Sosyal Sorumluluk a Sona Er.pdf
Rachel Hutchisson ile Kurumsal Sosyal Sorumluluk a Sona Er.pdf
ย 
Rabbits reproduce well like rabbits The average number of.pdf
Rabbits reproduce well like rabbits The average number of.pdfRabbits reproduce well like rabbits The average number of.pdf
Rabbits reproduce well like rabbits The average number of.pdf
ย 
R3 64 Bir rnga kartuunun retimi iin bir FMEA ina edilme.pdf
R3 64  Bir rnga kartuunun retimi iin bir FMEA ina edilme.pdfR3 64  Bir rnga kartuunun retimi iin bir FMEA ina edilme.pdf
R3 64 Bir rnga kartuunun retimi iin bir FMEA ina edilme.pdf
ย 
qus thes those is houth insuraned in the heyth ithretces He.pdf
qus thes those is houth insuraned in the heyth ithretces He.pdfqus thes those is houth insuraned in the heyth ithretces He.pdf
qus thes those is houth insuraned in the heyth ithretces He.pdf
ย 
Quin es ms probable que tenga fuertes capacidades de impl.pdf
Quin es ms probable que tenga fuertes capacidades de impl.pdfQuin es ms probable que tenga fuertes capacidades de impl.pdf
Quin es ms probable que tenga fuertes capacidades de impl.pdf
ย 
Question 9 Which of these statements is incorrect The LGN r.pdf
Question 9 Which of these statements is incorrect The LGN r.pdfQuestion 9 Which of these statements is incorrect The LGN r.pdf
Question 9 Which of these statements is incorrect The LGN r.pdf
ย 
Quickly research the benefits and risks of Artificial Intell.pdf
Quickly research the benefits and risks of Artificial Intell.pdfQuickly research the benefits and risks of Artificial Intell.pdf
Quickly research the benefits and risks of Artificial Intell.pdf
ย 
Queue Class Write a Queue class using doublylinked structu.pdf
Queue Class Write a Queue class using doublylinked structu.pdfQueue Class Write a Queue class using doublylinked structu.pdf
Queue Class Write a Queue class using doublylinked structu.pdf
ย 
Questions on Voters Registration a What are the qualific.pdf
Questions on Voters Registration   a What are the qualific.pdfQuestions on Voters Registration   a What are the qualific.pdf
Questions on Voters Registration a What are the qualific.pdf
ย 
Questions relating to PartyList System of Representation .pdf
Questions relating to PartyList System of Representation  .pdfQuestions relating to PartyList System of Representation  .pdf
Questions relating to PartyList System of Representation .pdf
ย 
Queston 1 a The purpose of Cache is to Increase response ti.pdf
Queston 1 a The purpose of Cache is to Increase response ti.pdfQueston 1 a The purpose of Cache is to Increase response ti.pdf
Queston 1 a The purpose of Cache is to Increase response ti.pdf
ย 
QUESTIONS TRUE OR FALSE 1 As the raw material of the plasti.pdf
QUESTIONS TRUE OR FALSE 1 As the raw material of the plasti.pdfQUESTIONS TRUE OR FALSE 1 As the raw material of the plasti.pdf
QUESTIONS TRUE OR FALSE 1 As the raw material of the plasti.pdf
ย 
Questions on Host Range Study the diagram on the next page a.pdf
Questions on Host Range Study the diagram on the next page a.pdfQuestions on Host Range Study the diagram on the next page a.pdf
Questions on Host Range Study the diagram on the next page a.pdf
ย 
QUESTIONS Some protocols call for a shorter incubation time .pdf
QUESTIONS Some protocols call for a shorter incubation time .pdfQUESTIONS Some protocols call for a shorter incubation time .pdf
QUESTIONS Some protocols call for a shorter incubation time .pdf
ย 
Questions for Endocrine system 1 Compare autocrine paracr.pdf
Questions for Endocrine system 1 Compare autocrine paracr.pdfQuestions for Endocrine system 1 Compare autocrine paracr.pdf
Questions for Endocrine system 1 Compare autocrine paracr.pdf
ย 
Questions on Differences in Virulence Study the diagram on t.pdf
Questions on Differences in Virulence Study the diagram on t.pdfQuestions on Differences in Virulence Study the diagram on t.pdf
Questions on Differences in Virulence Study the diagram on t.pdf
ย 
Questions for hearing and equilibrium the ear 1 What are .pdf
Questions for hearing and equilibrium the ear 1 What are .pdfQuestions for hearing and equilibrium the ear 1 What are .pdf
Questions for hearing and equilibrium the ear 1 What are .pdf
ย 
Questions 912 A study was conducted testing whether memory.pdf
Questions 912 A study was conducted testing whether memory.pdfQuestions 912 A study was conducted testing whether memory.pdf
Questions 912 A study was conducted testing whether memory.pdf
ย 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
ย 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
ย 

Recently uploaded (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
ย 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
ย 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
ย 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
ย 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
ย 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
ย 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
ย 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
ย 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
ย 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
ย 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
ย 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
ย 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
ย 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
ย 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
ย 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
ย 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
ย 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
ย 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
ย 

quickmeanpy datanumstxt this is the csvsplitpy file .pdf

  • 1. ^quickmean.py ^datanums.txt ^ this is the csvsplit.py file to or greater than 100 . 3. For the quickmean.py script modify the script to average 20 random selected numbers instead of al the data from datanums.txt.4! /usr/bin/env python # -*_ coding: utf- 8 _*_ expects one number per line FileName="datanums.txt" Total =0 Number =0 NumberList =[] for Item in Reader: NumberList. append(float(Item)) #print (NumberList) Total = Total + float(Item) Number = Number +1 Reader.close() print (NumberList) print ("The mean of %d values was %.2f" % (Number, Total/Number)) Line 1/23 Column: 1 Character 35(023) Encoding: 1252 (ANSI-La#1 /usr/bin/env python #-*-coding; utf-8 -*- ."split file and create a list FileName - "datasplit.txt" import csv # open the FileName for reading and parse with # the CSV reader function # Default is comas, give "excel-tab" for tabs. Eielditer = csv.reader (open(FileName, ' r '), dialect - "excel-tab') # Using list comprehension to parse at once # could also do a for loop # This creates a list of lists Fields = [Row for Row in Fielditer] print (Flelds)