Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Using OpenRefine
Using OpenRefine

Using OpenRefine: With this book on OpenRefine, managing and cleaning your large datasets suddenly got a lot easier! With a cookbook approach and free datasheets included, you'll quickly and painlessly improve your data managing capabilities.

eBook
$20.69 $22.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Using OpenRefine

Chapter 2. Analyzing and Fixing Data

In this chapter, we will go deeper into OpenRefine and review most of its basic functionalities intended for data fixing and analysis. We will cover the following topics, spread over six recipes:

  • Recipe 1 – sorting data

  • Recipe 2 – faceting data

  • Recipe 3 – detecting duplicates

  • Recipe 4 – applying a text filter

  • Recipe 5 – using simple cell transformations

  • Recipe 6 – removing matching rows

Even more so than in Chapter 1, Diving Into OpenRefine, the recipes are designed to allow readers to jump from one recipe to another in any way you like, depending on your needs and interests. Flowing reading of the chapter is also possible of course, but not mandatory at all.

Be warned that recipes are unequal in length; some are quite short and to the point, but others could not be constricted to one or two pages. Recipe 2 – faceting data, for instance, which covers the broad topic of faceting, runs over many pages and is divided into subrecipes.

Note

To follow the examples used...

Recipe 1 – sorting data


In this recipe, you will learn how to sort data as a visual aid and how to reorder rows permanently as a prerequisite for more advanced operations.

Because sorted values are easier to explore and manipulate, sorting data is certainly something you will want to do at some point when working with OpenRefine; you can either use the sorted values as a visual aid or reorder your records permanently. In order to sort your data by their Record ID, for instance, choose Sort... in the column menu to access the following window:

Cell values can be sorted according to their type: text (case-sensitive or not), numbers, dates, or Boolean values. For each type, we are offered two possible sorting orders:

  • Text: alphabetical (a to z) or reversed alphabetical (z to a)

  • Numbers: smallest first or largest first

  • Dates: earliest first or latest first

  • Booleans: false then true or true then false

Moreover, we can select where errors and blanks will be stored in relation to the valid values by dragging...

Recipe 2 – faceting data


One of the functionalities of OpenRefine that you will use most often is faceting. Facets do not affect the values of your data, but they allow you to get useful insights of your dataset; you can think of facets as various ways to look at your data, just like the facets of a gemstone that still have to be refined. Facets also allow you to apply a transformation to a subset of your data, as they allow you to display only rows corresponding to a given criterion.

In this recipe, we will explore the various ways of faceting data depending on their values and on your needs: text facets for strings, numeric facets for numbers and dates, a few predefined customized facets, and finally how to use stars and flags. Most of the power of OpenRefine lies in the ability to combine these different types of facets.

Text facets

If your dataset has a column containing cities or country names, for instance, you will want to see at a glance what the different values are for that field...

Recipe 3 – detecting duplicates


In this recipe, you will learn what duplicates are, how to spot them, and why it matters.

The only type of customized facet that we left out in the previous recipe is the duplicates facet. Duplicates are annoying records that happen to appear twice (or more) in a dataset. Keeping identical records is a waste of space and can generate ambiguity, so we will want to remove these duplicates. This facet is an easy way to detect them, but it has a downside; it only works on text strings, at least straightforwardly (to learn how to tweak it to work on integers as well, have a look at Appendix, Regular Expressions and GREL).

Too bad then; we cannot use a duplicate facet on the Record ID column. The next best thing is to run it on the registration numbers, which are an internal classification of objects in the collection, though they are not as reliable as the IDs, since they have an extrinsic meaning for collection managers. Anyway, let's give it a try by navigating...

Recipe 4 – applying a text filter


In this recipe, you will learn about filters that allow you to search for values displaying some patterns.

When you want to find rows matching a certain string, it is easier to rely on a simple text filter than on cumbersome facets. Let's start with a simple example. Suppose you want to filter all titles relating to the United States. Navigate to Object Title | Text filter and watch the filter box open on the left, in the same tab where facets appear. Now type in USA. OpenRefine tells you that there are 1,866 matching rows. Select the case sensitive checkbox to eliminate happenstance matches, such as karakusa and Jerusalem, and we are down to 1,737 rows:

Still, we cannot be sure that there is no noise left in these matches; there could be occurrences of JERUSALEM in capital letters for instance. To get around this problem, we could try to add spaces to either side of USA, but at the risk of losing cases, such as [USA] or /USA, along with occurrences of the...

Recipe 5 – using simple cell transformations


In this recipe, you will learn how to use OpenRefine's built-in transformations to modify subsets of your data.

When playing with facets and filters, we have essentially displayed the data in various ways, but we have not really affected them. Now comes the time to modify your data at last, and this means entering the powerful Edit cells menu. While we already used Blank down in order to detect duplicates, other transformations, such as splitting and joining multi-valued cells or clustering and editing values, are more advanced, so we will delay their discussion until the next chapter. Other transforms are easier to grasp; however, we will focus now on those available through the Common transforms submenu pictured in the following screenshot:

Trimming whitespace at the beginning and end of a string is a good first step to improve the quality of your data. It will ensure that their identical values will not differ by leading and trailing whitespace...

Recipe 6 – removing matching rows


In this recipe, you will learn how to suppress problematic rows that have been previously singled out through the use of facets and filters.

Detecting duplicates or flagging redundant rows is fine, but it is only part of the job. At some point, you will want to cross the mark between data profiling (or analysis) and data cleaning. In practice, this means that rows that have been identified as inappropriate during the diagnosis phase (and probably flagged as such) will need to be removed from the dataset, since they are detrimental to its quality.

To remove rows, be sure to have a facet or filter in place first, otherwise you will remove all rows in the dataset. Let's start from the clean project again (import it for a second time or toggle the Undo / Redo tab and select 0. Create project to cancel all modifications) and see what we can do to clean up this dataset. Also, check that OpenRefine shows your data as rows, not records.

We will first remove the rows...

Summary


During the course of this chapter, we have learned how to master the basics of OpenRefine in order to analyze and fix datasets, essential components of data profiling and cleaning.

Analyzing data involved sorting and the use of various facets, but also the application of text filters and the detection of duplicates.

Fixing data was accomplished through reordering, cell transformations, and deletion.

In the next chapter, we will bring our understanding of the inner workings of OpenRefine to another level by venturing into advanced data operations.

Left arrow icon Right arrow icon

Key benefits

  • Create links between your dataset and others in an instant
  • Effectively transform data with regular expressions and the General Refine Expression Language
  • Spot issues in your dataset and take effective action with just a few clicks

Description

Data today is like gold - but how can you manage your most valuable assets? Managing large datasets used to be a task for specialists, but the game has changed - data analysis is an open playing field. Messy data is now in your hands! With OpenRefine the task is a little easier, as it provides you with the necessary tools for cleaning and presenting even the most complex data. Once it's clean, that's when you can start finding value. Using OpenRefine takes you on a practical and actionable through this popular data transformation tool. Packed with cookbook style recipes that will help you properly get to grips with data, this book is an accessible tutorial for anyone that wants to maximize the value of their data. This book will teach you all the necessary skills to handle any large dataset and to turn it into high-quality data for the Web. After you learn how to analyze data and spot issues, we'll see how we can solve them to obtain a clean dataset. Messy and inconsistent data is recovered through advanced techniques such as automated clustering. We'll then show extract links from keyword and full-text fields using reconciliation and named-entity extraction. Using OpenRefine is more than a manual: it's a guide stuffed with tips and tricks to get the best out of your data.

Who is this book for?

This book is targeted at anyone who works on or handles a large amount of data. No prior knowledge is required, as we start from the very beginning and gradually reveal more advanced features. You don't even need your own dataset, as we provide example data to try out the book's recipes.

What you will learn

  • Import data in various formats
  • Explore datasets in a matter of seconds
  • Apply basic and advanced cell transformations
  • Deal with cells that contain multiple values
  • Create instantaneous links between datasets
  • Filter and partition your data easily with regular expressions
  • Use named-entity extraction on full-text fields to automatically identify topics
  • Perform advanced data operations with the General Refine Expression Language
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 10, 2013
Length: 114 pages
Edition : 1st
Language : English
ISBN-13 : 9781783289080
Vendor :
Google
Category :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Sep 10, 2013
Length: 114 pages
Edition : 1st
Language : English
ISBN-13 : 9781783289080
Vendor :
Google
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 148.97
Building Machine Learning Systems with Python
$54.99
Using OpenRefine
$38.99
Practical Data Analysis
$54.99
Total $ 148.97 Stars icon

Table of Contents

4 Chapters
Diving Into OpenRefine Chevron down icon Chevron up icon
Analyzing and Fixing Data Chevron down icon Chevron up icon
Advanced Data Operations Chevron down icon Chevron up icon
Linking Datasets Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(5 Ratings)
5 star 20%
4 star 60%
3 star 20%
2 star 0%
1 star 0%
David Branch Oct 22, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A really excellent book - very clear and well written and provided me with a very good base level of knowledge of this product. There are a couple of minor mistakes in the book, but these do not detract from its value. In my view, this is the best book available to get you going with OpenRefine.
Amazon Verified review Amazon
M. Heller Nov 19, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Disclosure: the publisher of this book provided me with a free copy in exchange for a review. The opinions expressed in the review are my own.While OpenRefine is an extremely useful "power tool for messy data", its power can be difficult to master without a great deal of trial and error on the part of the user. Part of this stems from the evolving nature of the tool. It began life as Freebase Gridworks, with the purpose of cleaning up data in order to run it against linked data in Freebase. When the Freebase parent organization was acquired by Google, they rebranded the tool as Google Refine, but as Google's priorities shifted, they stopped working on the tool and it became the open source OpenRefine. This legacy means that the tool has many pieces created by different people for different purposes. While there is quite a lot of good documentation out there on the OpenRefine site and elsewhere, this book puts it together in a easy to follow format. Like a lot of OpenRefine documentation, it is a series of "recipes" that explain how to do one specific task, but is written with the cover to cover reader in mind as well. The Google produced tutorial videos have similar coverage, but the book is more in depth, and has the advantage for readers coming from the cultural institution side of using a museum data set for examples. Another advantage is that the authors of the book have a particular interest in named entity recognition (part of the book covers the tool that one of them produced), which is particularly helpful for more abstract data sets with cultural data.Using OpenRefine is useful for beginner or intermediate users of OpenRefine. As someone who has used OpenRefine for awhile and written about its use in libraries, this was more helpful than I expected initially, since there were pieces of functionality I'd not yet encountered in experimentation or documentation so far. My one criticism is that much of the book promises a complete explanation in the appendix of regular expressions and the Google Refine Expression Language that powers the software, but I found that the GREL documentation was less useful than I hoped, though I still learned from it. I would have preferred if that section had been earlier in the book. That aside, I would recommend this book to anyone who has been using OpenRefine or thinking about using it, and additionally for library and museum professional development collections.
Amazon Verified review Amazon
Liath Appleton Oct 31, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Finally! A much needed introduction to OpenRefine. In my line of work I clean and organize data nearly every day. I use OpenRefine for the bulk of this work, and find myself training new students on a regular basis. This book and its tutorials have freed up my time, allowing students to learn the basics on their own. I am then able to focus more advanced training on the specifics of our particular data.This book assumes no prior knowledge of OpenRefine, but even as an advanced user I learned a few tricks I hadn't previously discovered. OpenRefine itself is an essential tool for anyone who works with large amounts of data, and anyone who needs to learn or teach OpenRefine will find this book to be a valuable addition to their library.
Amazon Verified review Amazon
Xavi Gimenez Nov 18, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good book about OpenRefine, readable as well and technically accurate. The provided dataset is also useful and it serves as a good example of what one can find in the real world.For non-technical users and those not used to work with data, the book helps with the steep learning curve that one can face with OpenRefine. For users that already work with data in his daily work, is a good chance to introduce OpenRefine to their data processing pipeline.The book and all its recipes covers all the basic (and not so basic) topics of OpenRefine, so gives to the user a good knowledge of what can be accomplished with the software. After covering all the essential topics, also offers a detailed introduction to the Regular Expressions and GREL, which improves exponentially the user's hability to work with data.Good complement to the existing OpenRefine resources that already exist on the net.
Amazon Verified review Amazon
Gwen E. Garrison Jul 04, 2016
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
For the money I expected more tips especially when handling various lengths of text such as addresses
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
Modal Close icon
Modal Close icon