# Data Exploration and Analysis Lessons

## Explore, Analyze and Visualize Environmental Data with R and Python

In Earth data science, often the greatest amount of time is spent figuring out how to open, clean up and explore your data. Once the data are cleaned up, you can then begin to visualize and analyze them. In the lessons below, learn the basic skills needed to open, clean up, plot and analyze scientific data.

## Activity: Plot Spatial Raster Data in Python

Practice your skills creating maps of raster and vector data using open source Python.

last updated: 21 Jan 2022

## Activity: Plot Time Series Data Using Pandas in Open Source Python

Practice your skills plotting time series data stored in Pandas Data Frames in Python.

last updated: 15 Sep 2020

## Activity: Practice Plotting Tabular Data Using Matplotlib and Pandas in Open Source Python

Practice your skills plotting time series data stored in Pandas Data Frames in Python.

last updated: 15 Sep 2020

## Summary Activity for Time Series Data

An activity to practice all of the skills you just learned in .

last updated: 11 Sep 2020

## Customize Dates on Time Series Plots in Python Using Matplotlib

When you plot time series data using the matplotlib package in Python, you often want to customize the date format that is presented on the plot. Learn how to customize the date format on time series plots created using matplotlib.

last updated: 11 Sep 2020

## Resample or Summarize Time Series Data in Python With Pandas - Hourly to Daily Summary

Sometimes you need to take time series data collected at a higher resolution (for instance many times a day) and summarize it to a daily, weekly or even monthly value. This process is called resampling in Python and can be done using pandas dataframes. Learn how to resample time series data in Python with Pandas.

last updated: 11 Sep 2020

## Subset Time Series By Dates Python Using Pandas

Sometimes you have data over a longer time span than you need for your analysis or plot. Learn how to subset your data using a begin and end date in Python.

last updated: 11 Sep 2020

## Work With Datetime Format in Python - Time Series Data

Python provides a datetime object for storing and working with dates. Learn how you can convert columns in a pandas dataframe containing dates and times as strings into datetime objects for more efficient analysis and plotting.

last updated: 11 Sep 2020

## Work With Datetime Format in Python - Time Series Data

Python provides a datetime object for storing and working with dates. Learn how you can convert columns in a pandas dataframe containing dates and times as strings into datetime objects for more efficient analysis and plotting.

last updated: 19 Jan 2022

## The Relationship Between Precipitation and Stream Discharge | Explore Mass Balance

Learn how to create a cumulative sum plot in Pandas to better understand stream discharge in a watershed

last updated: 11 Sep 2020

## Why A Hundred Year Flood Can Occur Every Year. Calculate Exceedance Probability and Return Periods in Python

Learn how to calculate exceedance probability and return periods associated with a flood in Python.

last updated: 11 Sep 2020

## Customize Matplotlibe Dates Ticks on the x-axis in Python

When you plot time series data in matplotlib, you often want to customize the date format that is presented on the plot. Learn how to customize the date format in a Python matplotlib plot.

last updated: 24 Sep 2020

## Customize Your Plots Using Matplotlib

Matplotlib is the most commonly used plotting library in Python. Learn how to customize the colors, symbols, and labels on your plots using matplotlib.

last updated: 16 Sep 2020

## Introduction to Plotting in Python Using Matplotlib

Matplotlib is the most commonly used plotting library in Python. Learn how to create plots using the matplotlib object oriented approach.

last updated: 02 Sep 2020

## Customize your Maps in Python using Matplotlib: GIS in Python

When making maps, you often want to create legends, customize colors, adjust zoom levels, or even make interactive maps. Learn how to customize maps created using vector data in Python with matplotlib, geopandas, and folium.

last updated: 21 Jul 2020

## Create interactive leaflet maps using folium in Jupyter Notebook: GIS in Python

Interactive maps allow you to easily explore data. Learn how to create interative leaflet maps embedded in a Jupyter Notebook using Python and folium.

last updated: 21 Jan 2022

## Customize Map Extents in Python: GIS in Python

When making maps, sometimes you want to zoom in to a specific area in your map. Learn how to adjust the x and y limits of your matplotlib and geopandas map to change the spatial extent that is displayed.

last updated: 21 Jan 2022

## Customize Map Legends and Colors in Python using Matplotlib: GIS in Python

When making maps, you often want to add legends and customize the map colors. Learn how to customize legends and colors in matplotlib maps created using vector data in Python.

last updated: 21 Jul 2020

## Overlay Raster and Vector Spatial Data in A Matplotlib Plot Using Extents in Python

When plotting raster and vector data together, the extent of the plot needs to be defined for the data to overlay with each other correctly. Learn how to define plotting extents for Python Matplotlib Plots.

last updated: 21 Jan 2022

## Customize Matplotlib Raster Maps in Python

Sometimes you want to customize the colorbar and range of values plotted in a raster map. Learn how to create breaks to plot rasters in Python.

last updated: 21 Jan 2022

## Interactive Maps in Python

Folium is a Python package that can be used to create interactive maps in Jupyter Notebook. Learn how to create interactive maps with raster overlays in Python using Folium.

last updated: 21 Jan 2022

## Layer a raster dataset over a hillshade in Python to create a beautiful basemap that represents topography.

A hillshade is a representation of the earth's surface as it would look with shade and shadows from the sun. Learn how to overlay raster data on top of a hillshade in Python.

last updated: 21 Jan 2022

## Plot Spatial Raster Data in Python.

When plotting rasters, you often want to overlay two rasters, add a legend, or make the raster interactive. Learn how to make a map of raster data that has these attributes using Python.

last updated: 21 Jul 2020

## Use Twitter Social Media Data in Python - An Introduction

last updated: 11 Sep 2020

## Sentiment Analysis of Colorado Flood Tweets in R

Learn how to perform a basic sentiment analysis using the tidytext package in R.

last updated: 03 Sep 2019

## Create Maps of Social Media Twitter Tweet Locations Over Time in R

This lesson provides an example of modularizing code in R.

last updated: 03 Sep 2019

## Use Tidytext to Text Mine Social Media - Twitter Data Using the Twitter API from Rtweet in R

This lesson provides an example of modularizing code in R.

last updated: 03 Sep 2019

## Text Mining Twitter Data With TidyText in R

Text mining is used to extract useful information from text - such as Tweets. Learn how to use the Tidytext package in R to analyze twitter data.

last updated: 03 Sep 2019

last updated: 13 Mar 2020

## Work With Twitter Social Media Data in R - An Introduction

This lesson will discuss some of the challenges associated with working with social media data in science. These challenges include working with non standard text, large volumes of data, API limitations, and geolocation issues.

last updated: 30 Mar 2020

## Adjust plot extent in R.

In this lesson you will review how to adjust the extent of a spatial plot in R using the ext() or extent argument and the extent of another layer.

last updated: 03 Sep 2019

## Plot Grid of Spatial Plots in R.

In this lesson you learn to use the par() or parameter settings in R to plot several raster RGB plots in R in a grid.

last updated: 03 Sep 2019

## How to Remove Borders and Add Legends to Spatial Plots in R.

In this lesson you review how to remove those pesky borders from a raster plot using base plot in R. We also cover adding legends to your plot outside of the plot extent.

last updated: 03 Sep 2019

## Layer a Raster Dataset Over a Hillshade Using R Baseplot to Create a Beautiful Basemap That Represents Topography

This lesson covers how to overlay raster data on a hillshade in R using baseplot and layer opacity arguments.

last updated: 03 Sep 2019

## Add a Basemap to an R Markdown Report Using ggmap

This lesson covers creating a basemap with the ggmap package in R. Given some ongoing bugs with ggmap it also covers the map package as a backup!

last updated: 30 Mar 2020

## Subset & Aggregate Time Series Precipitation Data in R Using mutate(), group_by() and summarise()

This lesson introduces the mutate() and group_by() dplyr functions - which allow you to aggregate or summarize time series data by a particular field - in this case you will aggregate data by day to get daily precipitation totals for Boulder during the 2013 floods.

last updated: 03 Sep 2019

## Homework Challenge: Plot USGS Stream Discharge Data in R

This lesson illustrated what your final stream discharge homework plots should look like for the week. Use all of the skills that you've learned in the previous lessons to complete it.

last updated: 03 Sep 2019

## Summarize Time Series Data by Month or Year Using Tidyverse Pipes in R

Learn how to summarize time series data by day, month or year with Tidyverse pipes in R.

last updated: 03 Sep 2019

## Use Tidyverse Pipes to Subset Time Series Data in R

Learn how to extract and plot data by a range of dates using pipes in R.

last updated: 03 Sep 2019

## Time Series Data: Work with Dates in R

Times series data can be manipulated efficiently in R. Learn how to work with, plot and subset data with dates in R.

last updated: 30 Mar 2020

## Plot Data and Customize Plots with ggplot Plots in R - Earth Analytics - Data Science for Scientists

Learn how to plot data and customize your plots using ggplot in R.

last updated: 03 Sep 2019