Python網頁爬蟲&文本處理&科學計算&機器學習&數據挖掘兵器譜(轉)

2021-12-26 牛衣古柳

轉載自「我愛自然語言處理」:www.52nlp.cn

已獲得授權

周末時看到這篇不錯的文章,其中介紹了諸多python第三方庫和工具,與大家分享下,也算是門可羅雀的本號第一次轉載文章。後續看到精彩的文章也會繼續分享。

Image Photograph by Pavliha Getty

曾經因為NLTK的緣故開始學習Python,之後漸漸成為我工作中的第一輔助腳本語言,雖然開發語言是C/C++,但平時的很多文本數據處理任務都交給了Python。

離開騰訊創業後,第一個作品課程圖譜也是選擇了Python系的Flask框架,漸漸的將自己的絕大部分工作交給了Python。這些年來,接觸和使用了很多Python工具包,特別是在文本處理,科學計算,機器學習和數據挖掘領域,有很多很多優秀的Python工具包可供使用,所以作為Pythoner,也是相當幸福的。

其實如果仔細留意微博,你會發現很多這方面的分享,自己也Google了一下,發現也有同學總結了「Python機器學習庫」,不過總感覺缺少點什麼。最近流行一個詞,全棧工程師(full stack engineer),作為一個苦逼的創業者,天然的要把自己打造成一個full stack engineer,而這個過程中,這些Python工具包給自己提供了足夠的火力,所以想起了這個系列。

當然,這也僅僅是拋磚引玉,希望大家能提供更多的線索,來匯總整理一套Python網頁爬蟲,文本處理,科學計算,機器學習和數據挖掘的兵器譜。

一、Python網頁爬蟲工具集

一個真實的項目,一定是從獲取數據開始的。無論文本處理,機器學習和數據挖掘,都需要數據,除了通過一些渠道購買或者下載的專業數據外,常常需要大家自己動手爬數據,這個時候,爬蟲就顯得格外重要了,幸好,Python提供了一批很不錯的網頁爬蟲工具框架,既能爬取數據,也能獲取和清洗數據,我們也就從這裡開始了:

1. Scrapy

Scrapy, a fast high-level screen scraping and web crawling framework for Python.

鼎鼎大名的Scrapy,相信不少同學都有耳聞,課程圖譜中的很多課程都是依靠Scrapy抓去的,這方面的介紹文章有很多,推薦大牛pluskid早年的一篇文章:《Scrapy 輕鬆定製網絡爬蟲》,歷久彌新。

官方主頁:http://scrapy.org/
Github代碼頁: https://github.com/scrapy/scrapy

2. Beautiful Soup

You didn’t write that awful page. You’re just trying to get some data out of it. Beautiful Soup is here to help. Since 2004, it’s been saving programmers hours or days of work on quick-turnaround screen scraping projects.

讀書的時候通過《集體智慧編程》這本書知道Beautiful Soup的,後來也偶爾會用用,非常棒的一套工具。客觀的說,Beautifu Soup不完全是一套爬蟲工具,需要配合urllib使用,而是一套HTML/XML數據分析,清洗和獲取工具。

官方主頁:http://www.crummy.com/software/BeautifulSoup/

3. Python-Goose

Html Content / Article Extractor, web scrapping lib in Python

Goose最早是用Java寫得,後來用Scala重寫,是一個Scala項目。Python-Goose用Python重寫,依賴了Beautiful Soup。前段時間用過,感覺很不錯,給定一個文章的URL, 獲取文章的標題和內容很方便。

Github主頁:https://github.com/grangier/python-goose

二、Python文本處理工具集

從網頁上獲取文本數據之後,依據任務的不同,就需要進行基本的文本處理了,譬如對於英文來說,需要基本的tokenize,對於中文,則需要常見的中文分詞,進一步的話,無論英文中文,還可以詞性標註,句法分析,關鍵詞提取,文本分類,情感分析等等。這個方面,特別是面向英文領域,有很多優秀的工具包,我們一一道來。

1. NLTK — Natural Language Toolkit

NLTK is a leading platform for building Python programs to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning, and an active discussion forum.

搞自然語言處理的同學應該沒有人不知道NLTK吧,這裡也就不多說了。不過推薦兩本書籍給剛剛接觸NLTK或者需要詳細了解NLTK的同學: 一個是官方的《Natural Language Processing with Python》,以介紹NLTK裡的功能用法為主,同時附帶一些Python知識,同時國內陳濤同學友情翻譯了一個中文版,這裡可以看到:推薦《用Python進行自然語言處理》中文翻譯-NLTK配套書;另外一本是《Python Text Processing with NLTK 2.0 Cookbook》,這本書要深入一些,會涉及到NLTK的代碼結構,同時會介紹如何定製自己的語料和模型等,相當不錯。

官方主頁:http://www.nltk.org/
Github代碼頁:https://github.com/nltk/nltk

2. Pattern

Pattern is a web mining module for the Python programming language.

It has tools for data mining (Google, Twitter and Wikipedia API, a web crawler, a HTML DOM parser), natural language processing (part-of-speech taggers, n-gram search, sentiment analysis, WordNet), machine learning (vector space model, clustering, SVM), network analysis and canvas visualization.

Pattern由比利時安特衛普大學CLiPS實驗室出品,客觀的說,Pattern不僅僅是一套文本處理工具,它更是一套web數據挖掘工具,囊括了數據抓取模塊(包括Google, Twitter, 維基百科的API,以及爬蟲和HTML分析器),文本處理模塊(詞性標註,情感分析等),機器學習模塊(VSM, 聚類,SVM)以及可視化模塊等,可以說,Pattern的這一整套邏輯也是這篇文章的組織邏輯,不過這裡我們暫且把Pattern放到文本處理部分。我個人主要使用的是它的英文處理模塊Pattern.en, 有很多很不錯的文本處理功能,包括基礎的tokenize, 詞性標註,句子切分,語法檢查,拼寫糾錯,情感分析,句法分析等,相當不錯。

官方主頁:http://www.clips.ua.ac.be/pattern

3. TextBlob: Simplified Text Processing

TextBlob is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more.

TextBlob是一個很有意思的Python文本處理工具包,它其實是基於上面兩個Python工具包NLKT和Pattern做了封裝(TextBlob stands on the giant shoulders of NLTK and pattern, and plays nicely with both),同時提供了很多文本處理功能的接口,包括詞性標註,名詞短語提取,情感分析,文本分類,拼寫檢查等,甚至包括翻譯和語言檢測,不過這個是基於Google的API的,有調用次數限制。TextBlob相對比較年輕,有興趣的同學可以關注。

官方主頁:http://textblob.readthedocs.org/en/dev/
Github代碼頁:https://github.com/sloria/textblob

4. MBSP for Python

MBSP is a text analysis system based on the TiMBL and MBT memory based learning applications developed at CLiPS and ILK. It provides tools for Tokenization and Sentence Splitting, Part of Speech Tagging, Chunking, Lemmatization, Relation Finding and Prepositional Phrase Attachment.

MBSP與Pattern同源,同出自比利時安特衛普大學CLiPS實驗室,提供了Word Tokenization, 句子切分,詞性標註,Chunking, Lemmatization,句法分析等基本的文本處理功能,感興趣的同學可以關注。

官方主頁:http://www.clips.ua.ac.be/pages/MBSP

5. Gensim: Topic modeling for humans

Gensim是一個相當專業的主題模型Python工具包,無論是代碼還是文檔,我們曾經用《如何計算兩個文檔的相似度》介紹過Gensim的安裝和使用過程,這裡就不多說了。

官方主頁:http://radimrehurek.com/gensim/index.html
github代碼頁:https://github.com/piskvorky/gensim

6. langid.py: Stand-alone language identification system

語言檢測是一個很有意思的話題,不過相對比較成熟,這方面的解決方案很多,也有很多不錯的開源工具包,不過對於Python來說,我使用過langid這個工具包,也非常願意推薦它。langid目前支持97種語言的檢測,提供了很多易用的功能,包括可以啟動一個建議的server,通過json調用其API,可定製訓練自己的語言檢測模型等,可以說是「麻雀雖小,五臟俱全」。

Github主頁:https://github.com/saffsd/langid.py

7. Jieba: 結巴中文分詞

「結巴」中文分詞:做最好的Python中文分詞組件 「Jieba」 (Chinese for 「to stutter」) Chinese text segmentation: built to be the best Python Chinese word segmentation module.

好了,終於可以說一個國內的Python文本處理工具包了:結巴分詞,其功能包括支持三種分詞模式(精確模式、全模式、搜尋引擎模式),支持繁體分詞,支持自定義詞典等,是目前一個非常不錯的Python中文分詞解決方案。

Github主頁:https://github.com/fxsjy/jieba

8. xTAS

xtas, the eXtensible Text Analysis Suite, a distributed text analysis package based on Celery and Elasticsearch.

感謝微博朋友 @大山坡的春 提供的線索:我們組同事之前發布了xTAS,也是基於python的text mining工具包,歡迎使用,連結:http://t.cn/RPbEZOW。看起來很不錯的樣子,回頭試用一下。

Github代碼頁:https://github.com/NLeSC/xtas

三、Python科學計算工具包

說起科學計算,大家首先想起的是Matlab,集數值計算,可視化工具及交互於一身,不過可惜是一個商業產品。開源方面除了GNU Octave在嘗試做一個類似Matlab的工具包外,Python的這幾個工具包集合到一起也可以替代Matlab的相應功能:NumPy+SciPy+Matplotlib+iPython。同時,這幾個工具包,特別是NumPy和SciPy,也是很多Python文本處理 & 機器學習 & 數據挖掘工具包的基礎,非常重要。最後再推薦一個系列《用Python做科學計算》,將會涉及到NumPy, SciPy, Matplotlib,可以做參考。

1. NumPy

NumPy is the fundamental package for scientific computing with Python. It contains among other things:
1)a powerful N-dimensional array object
2)sophisticated (broadcasting) functions
3)tools for integrating C/C++ and Fortran code
4) useful linear algebra, Fourier transform, and random number capabilities

Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.

NumPy幾乎是一個無法迴避的科學計算工具包,最常用的也許是它的N維數組對象,其他還包括一些成熟的函數庫,用於整合C/C++和Fortran代碼的工具包,線性代數、傅立葉變換和隨機數生成函數等。NumPy提供了兩種基本的對象:ndarray(N-dimensional array object)和 ufunc(universal function object)。ndarray是存儲單一數據類型的多維數組,而ufunc則是能夠對數組進行處理的函數。

官方主頁:http://www.numpy.org/

2. SciPy:Scientific Computing Tools for Python

SciPy refers to several related but distinct entities:

1)The SciPy Stack, a collection of open source software for scientific computing in Python, and particularly a specified set of core packages.
2)The community of people who use and develop this stack.
3)Several conferences dedicated to scientific computing in Python – SciPy, EuroSciPy and SciPy.in.
4)The SciPy library, one component of the SciPy stack, providing many numerical routines.

「SciPy是一個開源的Python算法庫和數學工具包,SciPy包含的模塊有最優化、線性代數、積分、插值、特殊函數、快速傅立葉變換、信號處理和圖像處理、常微分方程求解和其他科學與工程中常用的計算。其功能與軟體MATLAB、Scilab和GNU Octave類似。 Numpy和Scipy常常結合著使用,Python大多數機器學習庫都依賴於這兩個模塊。」—-引用自「Python機器學習庫」

官方主頁:http://www.scipy.org/

3. Matplotlib

matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell (ala MATLAB®* or Mathematica®†), web application servers, and six graphical user interface toolkits.

matplotlib 是python最著名的繪圖庫,它提供了一整套和matlab相似的命令API,十分適合交互式地進行製圖。而且也可以方便地將它作為繪圖控制項,嵌入GUI應用程式中。Matplotlib可以配合ipython shell使用,提供不亞於Matlab的繪圖體驗,總之用過了都說好。

官方主頁:http://matplotlib.org/

4. iPython

IPython provides a rich architecture for interactive computing with:

1)Powerful interactive shells (terminal and Qt-based).
2)A browser-based notebook with support for code, text, mathematical expressions, inline plots and other rich media.
3)Support for interactive data visualization and use of GUI toolkits.
4)Flexible, embeddable interpreters to load into your own projects.
5)Easy to use, high performance tools for parallel computing.

「iPython 是一個Python 的交互式Shell,比默認的Python Shell 好用得多,功能也更強大。 她支持語法高亮、自動完成、代碼調試、對象自省,支持 Bash Shell 命令,內置了許多很有用的功能和函式等,非常容易使用。 」 啟動iPython的時候用這個命令「ipython –pylab」,默認開啟了matploblib的繪圖交互,用起來很方便。

官方主頁:http://ipython.org/

四、Python 機器學習 & 數據挖掘 工具包

機器學習和數據挖掘這兩個概念不太好區分,這裡就放到一起了。這方面的開源Python工具包有很多,這裡先從熟悉的講起,再補充其他來源的資料,也歡迎大家補充。

1. scikit-learn: Machine Learning in Python

scikit-learn (formerly scikits.learn) is an open source machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support vector machines, logistic regression, naive Bayes, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy.

首先推薦大名鼎鼎的scikit-learn,scikit-learn是一個基於NumPy, SciPy, Matplotlib的開源機器學習工具包,主要涵蓋分類,回歸和聚類算法,例如SVM, 邏輯回歸,樸素貝葉斯,隨機森林,k-means等算法,代碼和文檔都非常不錯,在許多Python項目中都有應用。例如在我們熟悉的NLTK中,分類器方面就有專門針對scikit-learn的接口,可以調用scikit-learn的分類算法以及訓練數據來訓練分類器模型。這裡推薦一個視頻,也是我早期遇到scikit-learn的時候推薦過的:推薦一個Python機器學習工具包Scikit-learn以及相關視頻–Tutorial: scikit-learn – Machine Learning in Python

官方主頁:http://scikit-learn.org/

2. Pandas: Python Data Analysis Library

Pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series.

第一次接觸Pandas是由於Udacity上的一門數據分析課程「Introduction to Data Science」 的Project需要用Pandas庫,所以學習了一下Pandas。Pandas也是基於NumPy和Matplotlib開發的,主要用於數據分析和數據可視化,它的數據結構DataFrame和R語言裡的data.frame很像,特別是對於時間序列數據有自己的一套分析機制,非常不錯。這裡推薦一本書《Python for Data Analysis》,作者是Pandas的主力開發,依次介紹了iPython, NumPy, Pandas裡的相關功能,數據可視化,數據清洗和加工,時間數據處理等,案例包括金融股票數據挖掘等,相當不錯。

官方主頁:http://pandas.pydata.org/

=====================================================
分割線,以上工具包基本上都是自己用過的,以下來源於其他同學的線索,特別是《Python機器學習庫》,《23個python的機器學習包》,做了一點增刪修改,歡迎大家補充
=====================================================

3. mlpy – Machine Learning Python

mlpy is a Python module for Machine Learning built on top of NumPy/SciPy and the GNU Scientific Libraries.

mlpy provides a wide range of state-of-the-art machine learning methods for supervised and unsupervised problems and it is aimed at finding a reasonable compromise among modularity, maintainability, reproducibility, usability and efficiency. mlpy is multiplatform, it works with Python 2 and 3 and it is Open Source, distributed under the GNU General Public License version 3.

官方主頁:http://mlpy.sourceforge.net/

4. MDP:The Modular toolkit for Data Processing

Modular toolkit for Data Processing (MDP) is a Python data processing framework.
From the user’s perspective, MDP is a collection of supervised and unsupervised learning algorithms and other data processing units that can be combined into data processing sequences and more complex feed-forward network architectures.
From the scientific developer’s perspective, MDP is a modular framework, which can easily be expanded. The implementation of new algorithms is easy and intuitive. The new implemented units are then automatically integrated with the rest of the library.
The base of available algorithms is steadily increasing and includes signal processing methods (Principal Component Analysis, Independent Component Analysis, Slow Feature Analysis), manifold learning methods ([Hessian] Locally Linear Embedding), several classifiers, probabilistic methods (Factor Analysis, RBM), data pre-processing methods, and many others.

「MDP用於數據處理的模塊化工具包,一個Python數據處理框架。 從用戶的觀點,MDP是能夠被整合到數據處理序列和更複雜的前饋網絡結構的一批監督學習和非監督學習算法和其他數據處理單元。計算依照速度和內存需求而高效的執行。從科學開發者的觀點,MDP是一個模塊框架,它能夠被容易地擴展。新算法的實現是容易且直觀的。新實現的單元然後被自動地與程序庫的其餘部件進行整合。MDP在神經科學的理論研究背景下被編寫,但是它已經被設計為在使用可訓練數據處理算法的任何情況中都是有用的。其站在用戶一邊的簡單性,各種不同的隨時可用的算法,及應用單元的可重用性,使得它也是一個有用的教學工具。」

官方主頁:http://mdp-toolkit.sourceforge.net/

5. PyBrain

PyBrain is a modular Machine Learning Library for Python. Its goal is to offer flexible, easy-to-use yet still powerful algorithms for Machine Learning Tasks and a variety of predefined environments to test and compare your algorithms.

PyBrain is short for Python-Based Reinforcement Learning, Artificial Intelligence and Neural Network Library. In fact, we came up with the name first and later reverse-engineered this quite descriptive 「Backronym」.

「PyBrain(Python-Based Reinforcement Learning, Artificial Intelligence and Neural Network)是Python的一個機器學習模塊,它的目標是為機器學習任務提供靈活、易應、強大的機器學習算法。(這名字很霸氣)

PyBrain正如其名,包括神經網絡、強化學習(及二者結合)、無監督學習、進化算法。因為目前的許多問題需要處理連續態和行為空間,必須使用函數逼近(如神經網絡)以應對高維數據。PyBrain以神經網絡為核心,所有的訓練方法都以神經網絡為一個實例。」

官方主頁:http://www.pybrain.org/

6. PyML – machine learning in Python

PyML is an interactive object oriented framework for machine learning written in Python. PyML focuses on SVMs and other kernel methods. It is supported on Linux and Mac OS X.

「PyML是一個Python機器學習工具包,為各分類和回歸方法提供靈活的架構。它主要提供特徵選擇、模型選擇、組合分類器、分類評估等功能。」

項目主頁:http://pyml.sourceforge.net/

7. Milk:Machine learning toolkit in Python.

Its focus is on supervised classification with several classifiers available:
SVMs (based on libsvm), k-NN, random forests, decision trees. It also performs
feature selection. These classifiers can be combined in many ways to form
different classification systems.

「Milk是Python的一個機器學習工具箱,其重點是提供監督分類法與幾種有效的分類分析:SVMs(基於libsvm),K-NN,隨機森林經濟和決策樹。它還可以進行特徵選擇。這些分類可以在許多方面相結合,形成不同的分類系統。對於無監督學習,它提供K-means和affinity propagation聚類算法。」

官方主頁:http://luispedro.org/software/milk

http://luispedro.org/software/milk

8. PyMVPA: MultiVariate Pattern Analysis (MVPA) in Python

PyMVPA is a Python package intended to ease statistical learning analyses of large datasets. It offers an extensible framework with a high-level interface to a broad range of algorithms for classification, regression, feature selection, data import and export. It is designed to integrate well with related software packages, such as scikit-learn, and MDP. While it is not limited to the neuroimaging domain, it is eminently suited for such datasets. PyMVPA is free software and requires nothing but free-software to run.

「PyMVPA(Multivariate Pattern Analysis in Python)是為大數據集提供統計學習分析的Python工具包,它提供了一個靈活可擴展的框架。它提供的功能有分類、回歸、特徵選擇、數據導入導出、可視化等」

官方主頁:http://www.pymvpa.org/

9. Pyrallel – Parallel Data Analytics in Python

Experimental project to investigate distributed computation patterns for machine learning and other semi-interactive data analytics tasks.

「Pyrallel(Parallel Data Analytics in Python)基於分布式計算模式的機器學習和半交互式的試驗項目,可在小型集群上運行」

Github代碼頁:http://github.com/pydata/pyrallel

10. Monte – gradient based learning in Python

Monte (python) is a Python framework for building gradient based learning machines, like neural networks, conditional random fields, logistic regression, etc. Monte contains modules (that hold parameters, a cost-function and a gradient-function) and trainers (that can adapt a module’s parameters by minimizing its cost-function on training data).

Modules are usually composed of other modules, which can in turn contain other modules, etc. Gradients of decomposable systems like these can be computed with back-propagation.

「Monte (machine learning in pure Python)是一個純Python機器學習庫。它可以迅速構建神經網絡、條件隨機場、邏輯回歸等模型,使用inline-C優化,極易使用和擴展。」

官方主頁:http://montepython.sourceforge.net

11. Theano

Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. Theano features:
1)tight integration with NumPy – Use numpy.ndarray in Theano-compiled functions.
2)transparent use of a GPU – Perform data-intensive calculations up to 140x faster than with CPU.(float32 only)
3)efficient symbolic differentiation – Theano does your derivatives for function with one or many inputs.
4)speed and stability optimizations – Get the right answer for log(1+x) even when x is really tiny.
5)dynamic C code generation – Evaluate expressions faster.
6) extensive unit-testing and self-verification – Detect and diagnose many types of mistake.
Theano has been powering large-scale computationally intensive scientific investigations since 2007. But it is also approachable enough to be used in the classroom (IFT6266 at the University of Montreal).

「Theano 是一個 Python 庫,用來定義、優化和模擬數學表達式計算,用於高效的解決多維數組的計算問題。Theano的特點:緊密集成Numpy;高效的數據密集型GPU計算;高效的符號微分運算;高速和穩定的優化;動態生成c代碼;廣泛的單元測試和自我驗證。自2007年以來,Theano已被廣泛應用於科學運算。theano使得構建深度學習模型更加容易,可以快速實現多種模型。PS:Theano,一位希臘美女,Croton最有權勢的Milo的女兒,後來成為了畢達哥拉斯的老婆。」

12. Pylearn2

Pylearn2 is a machine learning library. Most of its functionality is built on top of Theano. This means you can write Pylearn2 plugins (new models, algorithms, etc) using mathematical expressions, and theano will optimize and stabilize those expressions for you, and compile them to a backend of your choice (CPU or GPU).

「Pylearn2建立在theano上,部分依賴scikit-learn上,目前Pylearn2正處於開發中,將可以處理向量、圖像、視頻等數據,提供MLP、RBM、SDA等深度學習模型。」

官方主頁:http://deeplearning.net/software/pylearn2/

其他的,歡迎大家補充。

歡迎關注「牛衣古柳」  

門可羅雀,快來捕鳥!

相關焦點

  • Python網頁爬蟲工具有哪些?
    一個真實的項目,一定是從獲取數據開始的。不管文本處理,機器學習和數據發掘,都需求數據,除了通過一些途徑購買或者下載的專業數據外,常常需求我們自己著手爬數據,爬蟲就顯得分外重要。那麼,Python網頁爬蟲東西有哪些呢?
  • 初學者如何用「python爬蟲」技術抓取網頁數據?
    在當今社會,網際網路上充斥著許多有用的數據。我們只需要耐心觀察並添加一些技術手段即可獲得大量有價值的數據。而這裡的「技術手段」就是指網絡爬蟲。 今天,小編將與您分享一個爬蟲的基本知識和入門教程:什麼是爬蟲?網絡爬蟲,也叫作網絡數據採集,是指通過編程從Web伺服器請求數據(HTML表單),然後解析HTML以提取所需的數據。
  • 156個Python網絡爬蟲資源,媽媽再也不用擔心你找不到資源
    本列表包含Python網頁抓取和數據處理相關的庫。Python項目以簡化處理難度hodor – 支持lxml and cssselect的配置驅動包裝工具清理Bleach – 清理HTML (需求html5lib)sanitize – 將混亂的數據世界恢復清楚文本處理解析及操作文本的庫通用difflib – 差異化計算工具
  • 讓所有程式設計師絕不能錯過的59個Python庫總結!
    Python有以下三個特點:易用性和靈活性全行業高接受度:Python無疑是業界最流行的數據科學語言用於數據科學的Python庫的豐富數量優勢本文介紹了python人最常用的59個python庫。一起來看看吧~用於數據收集的Python庫1.
  • 學了Python一般可以用來幹什麼呢?
    youtube 世界最大的視頻網站也是Python開發的哦.還有非常出名的instagram 也是用python開發的2,網絡爬蟲爬蟲是屬於運營的比較多的一個場景吧,比如谷歌的爬蟲早期就是用跑Python寫的. 其中有一個庫叫 Requests ,這個庫是一個模擬HTTP請求的一個庫,非常的出名!
  • 花了好幾天整理出來的Python庫,非常全面!
    調試工具 深度學習 文檔 下載器 電子商務 編輯器插件和IDE 電子郵件 環境管理 GUI 遊戲開發 地理位置 HTML操作 硬體 圖像 交互界面 日誌 機器學習 自然語言處理 包管理 科學計算 特殊格式處理 視頻
  • 【數據挖掘】數據存儲——保存抓取的數據為文本文件+異常處理
    不可能把代碼文件發給別人嗎,讓別人再運行程序,別人只是想要這份數據而已,並不關心數據怎麼獲取的,也不需要了解原始碼。最好的方式就是把獲取的數據保存到計算機中長期存儲,並且以大家都能看得懂的格式保存。最常見的存儲方式就是文本文件,就是後綴為.txt的文件,還有.csv文件,word文件,excel文件等,這裡我們從最簡單的.txt文本文件開始。
  • 深圳Python培訓班打造行業高標準Python人才
    豆瓣就是使用Python作為Web開發作為基礎語言,知乎的整個架構也是基於Python語言更勝一籌大數據方向、運維方向等多種方向。各種類型的企業實戰項目,一比一教學。2、python目前在各個方向都有不錯的前景,雖然現在 看起來比java就業的崗位相對少,但是在的發展,每天都會新增大量的就業崗位,python在人工智慧,科研,圖形繪製,linux運維,python自動化測試, python web ,爬蟲,數據分析等等方向。3.人工智慧與機器學習的崛起:近幾年,大數據、人工智慧、機器學習也是越來越受關注, 以至於普遍的人都對其有所耳聞。
  • 5分鐘快速學習掌握python爬蟲Beautifulsoup解析網頁
    python爬蟲用Beatifulsoup庫解析網頁提取所需元素新手看懂個人觀點:之前我們有講過爬蟲和網頁的一些聯繫,網頁的一些組成部分,爬蟲就是對網頁裡面的數據進行提取然後對其進行數據處理,篩選出所需部分,供需要者使用。
  • Python常用庫大全
    python-nameparser – 把一個人名分解為幾個獨立的部分。 python-user-agents – 瀏覽器 user agent 解析器。 sqlparse – 一個無驗證的 SQL 解析器。 特殊文本格式處理一些用來解析和操作特殊文本格式的庫。通用 tablib – 一個用來處理中表格數據的模塊。
  • 文本複述,中文文本數據增強
    改進谷歌的LaserTagger模型,使用LCQMC等中文語料訓練文本複述模型,即修改一段文本並保持原有語義。複述的結果可用於數據增強,文本泛化,從而增加特定場景的語料規模,提高模型泛化能力。可能是語言和任務不同,在中文文本複述上的評測分數比公開數據集高一些。
  • Python 爬蟲實戰:貓眼電影
    作者:AJ-Gordon,數據分析師一枚,對爬蟲,機器學習,數據可視化,數據建模均有所涉獵。
  • Python學了有什麼用?一定可以提高你的工作效率-開課吧
    Google是從一開始就使用python的公司。那麼使用Python能幹什麼呢?此時可以用Python批量處理這些文件,然後按照需求進行運算並顯示結果2、自動填寫表單並提交。很多人的工作是在網頁或者軟體上填寫內容然後提交,這塊工作其實完全也可以交給Python去做,如果我們有明確的數據源的話(比如文本文件),我們可以規定好規則,文件的那些內容填寫到網頁的哪些位置,然後自動提交。
  • Kaggle文本語義相似度計算Top5解決方案分享
    數據集未經過脫敏處理,用真實的英文單詞標識https://dc.cloud.alipay.com/index#/topic/intro?id=8問題相似度計算,即給定客服裡用戶描述的兩句話,用算法來判斷是否表示了相同的語義。
  • Python3網絡爬蟲(一):利用urllib進行簡單的網頁抓取
    /python3-tutorial.html    (3)魚C工作室Python教程(視頻):    小甲魚老師很厲害,講課風格幽默詼諧,如果時間充裕可以考慮看視頻。網絡爬蟲就是根據網頁的地址來尋找網頁的,也就是URL。
  • 手把手教你用Python爬中國電影票房數據
    導入pandas包後,字典和列表都可以轉化為DataFrame,以上面的字典為例,轉化為DataFrame是這樣的:import pandas as pddf=pd.DataFrame.from_dict(zidian,orient='index',columns=['age'])df=df.reset_index().rename(columns
  • 什麼是Python爬蟲?華為科普知識來看看
    不用愁,下面一文帶你走近爬蟲世界,讓即使身為ICT技術小白的你,也能秒懂使用Python爬蟲高效抓取圖片。什麼是專用爬蟲?網絡爬蟲是一種從網際網路抓取數據信息的自動化程序。如果我們把網際網路比作一張大的蜘蛛網,數據便是存放於蜘蛛網的各個節點,而爬蟲就是一隻小蜘蛛(程序),沿著網絡抓取自己的獵物(數據)。
  • 為什麼企業都在用Python做數據分析?
    Python和其他數據分析工具的比較 1、在處理大量數據時,Python的效率高於Excel;可以更容易地實現自動分析;建立複雜的機器學習模型相對容易。
  • python為什麼叫爬蟲?為啥那麼多人通過python兼職都能掙不少錢?
    Python能做什麼之前有很多文章介紹python能做什麼。今天介紹python爬蟲的學習。網絡爬蟲 網絡爬蟲,也叫網絡蜘蛛(Web Spider)。爬蟲是根據網頁地址(URL)爬取網頁上的內容,這裡說的網頁地址(URL)就是我們在瀏覽器中輸入的網站連結。例如:https://www.baidu.com/,這就是一個URL。