Giter Site home page Giter Site logo

sectumpsempra / gsoc_task Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 871 KB

User can query the Database to find about dst index and its hourly values from January 1957 to February 2018

Python 100.00%
python3 python-mysql mysql-connector pandas csv-files dat-files database query-builder

gsoc_task's Introduction

GSoC_Task

Task's Readme Page

The .dat files downloaded from the internet is processed using preProcess.py to generate a DST_DATA.csv file, which contains the data as per the format shown here alt text

Step - 1 =>

pip install mysql-connector pip install pandas

Step - 2 =>

  1. Run preProcess.py after modifying the location in which you have kept .dat file downloaded from github in this case or the internet from here dst webpage

Step - 3 =>

Code used to convert CSV file's data to a database table in mysql.

  1. mysql [username] [password] or mysql -p -u root

  2. Enter the following into mysql console from your local directory i.e., where DST_DATA.csv file is saved => CREATE TABLE dstdata (dat LONG not null,mont LONG not null,yea LONG,star VARCHAR(20),quicklook VARCHAR(20),inde VARCHAR(20),versio VARCHAR(20),basevalue VARCHAR(20),hourlyvalue VARCHAR(200), meanvalue VARCHAR(100));

  3. Follow up => load data local infile
    'DST_DATA.csv'
    INTO TABLE dstdata FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (dat, mont, yea, star, quicklook, inde, versio, basevalue, hourlyvalue, meanvalue);

Step - 4 =>

  1. Run QueryDST.py file and enter the query you want to run, please take help from the internet if you are not familiar with MySQL database queries, the "Field in DB" column printed in output shows the name of the columns in table "dstdata" which will be used to do queries.

Result =>

alt text

Still some changes left to be done. Thank You.

gsoc_task's People

Contributors

sectumpsempra avatar

Watchers

 avatar  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.