程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python Chapter 14 data analysis cases

編輯:Python

The last chapter of the book , Let's look at some real-world datasets . For each data set , We will use the method introduced before , Extract meaningful content from raw data . The method presented is applicable to other data sets , Including yours . This chapter contains a variety of case datasets , It can be used to practice .

Case datasets can be found in Github Warehouse found , See Chapter one .

#14.1 come from Bitly Of USA.gov data

2011 year ,URL Shorten service Bitly With the US government website USA.gov cooperation , Provides a copy of the generated from .gov or .mil Anonymous data collected from users with short links . stay 2011 year , In addition to real-time data , You can also download hourly snapshots in the form of text files . When writing this book (2017 year ), The service has been shut down , But we keep a copy of the data for the case of this book .

Take the hourly snapshot as an example , The format of each line in the file is JSON( namely JavaScript Object Notation, This is a common Web data format ). for example , If we only read the first line in a file , Then the result should be as follows :

In [5]: path = 'datasets/bitly_usagov/example.txt'
In [6

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved