原创 python中pandas

import pandas as pd bj=pd.Series([4,7,-5,3])#產生帶索引的一維數組 bj.values#返回數組值 bj

原创 python爬蟲 爬取頁面鏈接

#coding=utf-8 from bs4 import BeautifulSoup import lxml   import urllib fr

原创 python爬取圖片

import urllib.request,socket,re,sys,os   targetPath = "D:\\python_code\\pi

原创 python 編碼 亂碼問題

爲什麼Python使用過程中會出現各式各樣的亂碼問題,明明是中文字符卻顯示成“\xe4\xb8\xad\xe6\x96\x87”的形式? 爲什麼會報錯“UnicodeEncodeError: 'ascii' codec can't e

原创 python 結巴分詞中 按行讀取 csv中的文件 並將分詞存儲到csv中

#coding='utf-8'impo#coding='utf-8' import csv import jiebaimport pandas as

原创 python中numpy使用

import numpy as np#導入numpy data=[[1,2,3],[4,5,6]]#創建元組 arr=np.array(data)#

原创 python 編碼 亂碼 問題2

1、Python本身對各種語言支持都很好,字符串在python內部是用unicode編碼表示的。 python支持兩種編碼格式,一個是UCS-2,一個是UCS-4,可以通過如下方式查看是那種: >>> import sys >>>

原创 命名體識別

from bosonnlp import BosonNLP file_object2=open('D:\A仲敏2015\python_code\\企業名實體匹配.txt').read().split('\n') #一行行的讀取內容

原创 python如何查看編碼類型

##查看編碼類型 import chardet chardit1 = chardet.detect(cf_r)#cf_r爲要查看的編碼 print (cf_r['encoding'])

原创 Jupyter 技巧

Toggle navigation Focus on ML & DM [譯]27 個Jupyter Notebook的小提示與技巧 Date  二 08 十一月 2016 Tags Jupyter notebo

原创 python 自然語言處理 代碼實現(批量讀取,分詞,詞向量化)

#coding=utf-8 #coding=gbk import pandas as pd import jieba import codecs import pandas as pd #decode_set=['ANSI','utf-

原创 自然語言內容

作者:微軟亞洲研究院 鏈接:https://www.zhihu.com/question/19895141/answer/149475410 來源:知乎 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。 自然語言處理(

原创 jieba說明文檔

jieba “結巴”中文分詞:做最好的 Python 中文分詞組件 "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best

原创 gensim詞袋向量化

https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/gensim%20Quick%20Start.ipynb Getting Start

原创 tensorflow 實現word2vec

# coding: utf-8 # In[151]: import jieba import tensorflow as tf import numpy as np import math import collections im