Python Programming Challenge

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Advertisements

Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Scite Scintilla integrated text editor. Click here.
Separating Columns in Excel. An extremely useful function in Excel is the Text to Column feature which can be used for any type of column separation but.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 35 – Python Outline 35.1 Introduction First Python Program Python Keywords 35.2 Basic.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Working Out with KURL! Shayne Koestler Kinetic Data.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Introduction to Computational Linguistics Programming I.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
MEGN 537 – Probabilistic Biomechanics Applying the AMV Method with a Finite Element Model Anthony J Petrella, PhD.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
PowerPoint Extras. Eyes to the front please! Action Buttons.
Introduction to Programming G50PRO University of Nottingham Unit 2 : Introduction To Scratch Paul Tennent
Python Basic. Download python Go to and download Python 2.7.8www.python.org.
Computer Security coursework 1 Dr Alexei Vernitski.
Scripting Languages James Brucker Computer Engineering Dept Kasetsart University.
How do I export the Address Book to Excel? The first step is to go to "Address Book Report" under Admin Only menu Choose the fields you want. note that.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 1: Introduction.
Image #1 Getting Started
Data Model / Database Implementation (continued) Jeffery S. Horsburgh Hydroinformatics Fall 2014 This work was funded by National Science Foundation Grants.
Copy of the from the secure website - click on the AccoridaLife.zip link.
Python – May 16 Recap lab Simple string tokenizing Random numbers Tomorrow: –multidimensional array (list of list) –Exceptions.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
Microsoft Access Prepared by the Academic Faculty Members of IT.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
Intelligent Data Systems Lab. Department of Computer Science & Engineering Python Installation guide 컴퓨터의 개념 및 실습.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
Lecture 9 Using Structured Query Language (SQL) Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant.
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2015 This work was funded by National Science.
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jon Goodall Hydroinformatics Fall 2014 This work was funded by National Science Foundation.
Lecture 7 Datalogger Programming Using Arduino – Part 2
4.01 How Web Pages Work.
Multimedia Summer Camp
Introducing Python Introduction to Python.
CST 1101 Problem Solving Using Computers
Intro to Python Programming – Part III
Computer Science A-level
USING PYTHON to Automate data management tasks
Lecture 19 Automating Preparing and Entering Model Data in WEAP
Using Python to Interact with the EPA WATERS Web Services
CSC 458– Predictive Analytics I, Fall 2017, Intro. To Python
Introduction to Python
IST256 : Applications Programming for Information Systems
Lecture 1 Introduction to Python Programming
Lecture 22: Using ArcToolbox Tools in Python
Corpus Linguistics I ENG 617
Datalogger Programming Using Arduino – Part 2
Using Python to Interact with the EPA WATERS Web Services (part 2)
Fill the screen challenge!
Week 1 Computer Programming Year 9 – Unit 9.04
Nate Brunelle Today: PyCharm
Test Automation For Web-Based Applications
CSC 458– Predictive Analytics I, Fall 2018, Intro. To Python
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
In the home page, click on “Reports”
CS 1111 Introduction to Programming Spring 2019
Image #1 Getting Started
12th Computer Science – Unit 5
Introduction to Computer Science
Virginia Lenvik Geography 375 Spring 2013
Introduction to JavaScript
Computer Science A-level
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python Programming Challenge Jeffery S. Horsburgh Hydroinformatics Fall 2016 This work was funded by National Science Foundation Grants EPS 1135482 and EPS 1208732

Objectives Introduction to the Python programming language Write and execute computer code to automate repetitive tasks Discover and access data from major data sources Retrieve and use data from common hydrologic data sources

Coding Challenge

Get the Data http://waterdata.usgs.gov/nwis/uv?cb_00060=on&format=rdb&site_no=10109000&period=&begin_date=2015-10-01&end_date=2015-10-31

Coding Challenge Choose a real-time streamflow gage from the USGS that you are interested in. It could be a nearby gage or one that is near and dear to your heart. To see an interactive map of gage locations, go to: http://maps.waterdata.usgs.gov/mapper/index.html Create a Python script that does the following: Download the most recent data from the USGS website Read the file Extract the most recent streamflow value from the file Print the most recent streamflow value and the date at which it occurred to the screen

Example Solution “The most recent streamflow value for USGS Gage 10109000 was 109 cfs on 2014-08-25 3:15.”

Step 1: Create a New PyCharm Project Open PyCharm Select File  New Project Name your project and select the interpreter

Step 2: Create a New Python Script Right click on your project folder Select New  Python File Name your script

Step 3: Write Some Pseudo Code

Step 4: Write Some Real Code

Some Hints Develop your solution as a script in PyCharm The USGS website returns the data as a file, but you have to request it using a URL in your code. The Python module called “urllib2” (for Python 2.7) or “urllib3” for Python 3 is one option for downloading a file using a URL. The data are returned in a text file where each new line represents a new date/time and data value. Each new line is delineated with a new line character. Each element within a line is delimited by a tab character. Check out the Python “split” method for splitting a string based on a delimiter