From the course: Python Data Analysis

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Loading station and temperature data

Loading station and temperature data - Python Tutorial

From the course: Python Data Analysis

Loading station and temperature data

- [Instructor] Before loading the data, it's always a good idea to start by looking at the documentation. Browsing through the file listing at the noaa repository we see a readme.txt. We'll start there. The readme file is also included in this chapters directory. It describes the content of the repository, the format of the weather data files, which have an ending DLY, and which contain data for a single station formatted with fixed width columns. Lots of detail here. Next, the readme file describes the format of a file ghcnd stations.txt. That gives us the location, elevation, and ID for each station in the network. We'll start with this station's database. For your reference, I have copied the description of the files format into this notebook. To load a fixed width text file such as this, we can use numpy genfromtext. It needs rather precise information. We specify the width of each field in the parameter delimiter. We can direct the widths from the table above, but we need to…

Contents