Skip to Content
Bad Data 技術手冊
book

Bad Data 技術手冊

by Q. Ethan McCallum
September 2013
Intermediate to advanced
264 pages
5h
Chinese
GoTop Information, Inc.
Content preview from Bad Data 技術手冊
53
第四章
隱藏在純文字中的壞資料
Josh Levy, PhD
這是 Unix 的哲學:撰寫做一件事且做得很好的程式。
撰寫能夠一起運作的程式。撰寫能夠處理文字的程式,
因為這是最普遍的介面。
Doug McIlroy
取得壞資料時,通常會帶著警告或是道歉的文字,如「這堆資料非常混亂,但也許你能
夠在裡面找到一些東西。」有時候壞資料會帶有更空泛的標示:「這是一個純文字且使用
tab 分隔的檔案。它不會給你帶來任何的問題。」
在本篇文章中,會呈現當我對純文字檔案執行看似簡單的資料分析時所遭遇到的問題,
以及解決這些問題的策略。我將會討論以下的問題:
1. 未知的文字編碼
2. 不正確的文字編碼
3. 應用程式限定的字元洩漏至純文字檔案中
我會使用 Python 撰寫部分的程式碼,來描述這些問題以及它們的答案。要執行我的展
示程式只需要安裝 Python 2.7.2 就可以了,不需要其他任何的條件。然而,有許多優秀
Python 開放原始碼函式庫都可以用來作文字處理。到本章結束時,我會提到一些我
最愛的函式庫。同時也會歸納出一些習題,讓讀者能夠在公開可取得的資料上執行。
53
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

RxJava反应式编程

RxJava反应式编程

Tomasz Nurkiewicz, Ben Christensen
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9789862768952