Giter Site home page Giter Site logo

simple-csv-merging's Introduction

The details about problem is You have two sets of csv files - one containing the contracts data and the other containing the awarded contracts. Your task is to combine the two csv files using the common field (contractName) and compute the total amount of closed awarded contracts. The combined csv should also include one more field - latlon which contains the geocoded value of the contract location, if available. Use the API (from google, osm, or others) to geocode the location.

There are problems with the data, which means there are closed contracts which have not been awarded yet.

The data are not real data and presented for this problem only. The data fields and real data are available at http://www.edolidar.gov.np/tenders.php

The first contract file contains the following fields

contractname
status
bidPurchaseDeadline
bidSubmissionDeadline
bidOpeningDate
tenderid
publicationDate
publishedIn

The second award file contains the following fields

contractName
contractDate
completionDate
awardee
awardeeLocation
Amount

The output file will contain the fields from both files (blank values if the contract is not awarded yet)

contractname
status
bidPurchaseDeadline
bidSubmissionDeadline
bidOpeningDate
tenderid
publicationDate
publishedIn
contractDate
completionDate
awardee
awardeeLocation
latlon
Amount

After the file is created, read the output file and show the total amount of awarded contracts which have been closed. 700,000 in our case.

The solution of the problem is done in Python using Pandas package and geopy module . The Output of the project is final_output.csv

To run the script you should have python 2.7 installed in your machine. Along with Python your machine should have pandas package and geopy module installed. To install Python on your machine 1. For ubuntu and mac user you have already python installed in your machine . No worries for python. :D 2. For Windows user go to https://www.python.org/downloads/

To install Pandas 

http://pandas.pydata.org/pandas-docs/stable/install.html

To install geopy

https://pypi.python.org/pypi/geopy

To run the script
  i)  open your terminal
  ii) type "python solution.py "

simple-csv-merging's People

Contributors

jigyasup avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.