Skip to Content
Analyzing and Visualizing Data with F#
book

Analyzing and Visualizing Data with F#

by Tomas Petricek
October 2015
Beginner to intermediate
40 pages
1h 6m
English
O'Reilly Media, Inc.
Content preview from Analyzing and Visualizing Data with F#

Chapter 2. Analyzing Data Using F# and Deedle

In the previous chapter, we carefully picked a straightforward example that does not require too much data preprocessing and too much fiddling to find an interesting visualization to build. Life is typically not that easy, so this chapter looks at a more realistic case study. Along the way, we will add one more library to our toolbox. We will look at Deedle,1 which is a .NET library for data and time series manipulation that is great for interactive data exploration, data alignment, and handling missing values.

In this chapter, we download a number of interesting indicators about countries of the world from the World Bank, but we do so efficiently by calling the REST service directly using an XML type provider. We align multiple data sets, fill missing values, and build two visualizations looking at CO2 emissions and the correlation between GDP and life expectancy.

We’ll use the two libraries covered in the previous chapter (F# Data and XPlot) together with Deedle. If you’re referencing the libraries using the FsLab package as before, you’ll need the following open declarations:

#r "System.Xml.Linq.dll"
#load "packages/FsLab/FsLab.fsx"
open Deedle
open FSharp.Data
open XPlot.GoogleCharts
open XPlot.GoogleCharts.Deedle

There are two new things here. First, we need to reference the System.Xml.Linq library, which is required by the XML type provider. Next, we open the Deedle namespace together with extensions that let us pass data from ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

F# High Performance

F# High Performance

Eriawan Kusumawardhono
F# Deep Dives

F# Deep Dives

Phillip Trelford, Tomas Petricek

Publisher Resources

ISBN: 9781492048350Errata Page