Sunday, 9 August 2015
Radish survey
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.
A survey was conducted for a greengrocer to see what radish varieties customers prefer. We got 300 lines of survey data. Each line consists of a name, a hyphen then a radish variety.
| Code to read the data line by line |
| Count all the votes |
The problems associated with this data are:
1. The survey contains many unclean data. So we have to write a program to munge the data so that all the data looks the same.
1. The survey contains many unclean data. So we have to write a program to munge the data so that all the data looks the same.
2. Some of the votes have double space in between 1st and 2nd word. So 'replace' function is used to replace the double space with single space.
| To replace the double space |
| To check fraudalence |
| Winner |
Subscribe to:
Posts (Atom)