WSQ 13 – Cars

--Originally published at Programming

Instructions: Write a program that opens and reads the file 93cars.dat.txt and produces the following data:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

Data from: Journal of Statistics Education.

Code:

Captura de pantalla 2017-05-04 a la(s) 15.49.08

Data:

Captura de pantalla 2017-05-04 a la(s) 15.53.16.png

How it runs:

Captura de pantalla 2017-05-04 a la(s) 15.48.57

 

Mastery topics: Reading and writing of text files


WSQ13

--Originally published at Dude, Suckin' at something is the first step to being sorta good at something!

I was asked to analyze a file containing around of 153 lines of technial information about cars. Every two lines a new car will show its technical spec’s, so the program had to cound spaces in order to find the correct spaces in where he desired information was written. So after finding the info I converted it to float. Then I was able to manipulate the data to my own desire which was to get the city, highway MPG average and the mid price average. Thanks oscar blog for offering a clean code and good structure.

THE CODE

WSQ13 CODE

THE PRINTSWSQ13 SS


#WSQ13 – Cars

--Originally published at マルコ

What To Do

File input/output is our access to permanent stores of data that last beyond the run time of our application.

Write a program that opens and reads the file 93cars.dat.txt and produces the following data:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

You can find the data set at the following link from the Journal of Statistics Education.

W13.1

Featured image:

https://www.pixiv.net/member_illust.php?mode=medium&illust_id=3061999


WSQ13 – Cars

--Originally published at Elu's Blog

For this assignment these were my instructions:

File input/output is our access to permanent stores of data that last beyond the run time of our application.

Write a program that opens and reads the file 93cars.dat.txt and produces the following data:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

You can find the data set at the following link from the Journal of Statistics Education.

This is what I came up with:

Captura de pantalla 2017-04-24 a la(s) 21.08.37.png

Captura de pantalla 2017-04-24 a la(s) 21.08.50.png


Cars! ?

--Originally published at Python learning

Another activity I did was to create a program that would open and read a file called 93cars.dat.txt, gotten from this page, and calculate the following:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

I had worked with text files in a previous problem, so I went back to my post about it in order to remember the proper commands:

https://pythoncoursesite.wordpress.com/2017/03/08/files/

After that, this is the program I wrote:

carscars_run

And that’s it! ❤