Time of Update: 2016-11-20
標籤:python 載入excel報錯from pandas import Series, DataFrameimport pandas as pdimport numpy as npimport osimport sysreload(sys)sys.setdefultencoding(‘utf-8‘)file1=pd.read_excel(‘F:/dataanalysis/statistics/PelicanStores.xlsx‘)Python 載入excel報錯:IndexError:
Time of Update: 2016-11-21
標籤:blog pytho local ring strftime mkt date tuple ftime import datetimeimport
Time of Update: 2016-11-16
標籤:大量 通過 uid 安裝 int title imp 模擬 中文 官網: http://locust.io/GitHub: https://github.com/loc
Time of Update: 2016-11-17
標籤:python fabric 模組 介紹及簡單應用來源:《Python自動化營運》Fabric的安裝Fabric支援pip、easy_install或源碼安裝方式,很方便解決包依賴的問題,具體安裝命令如下(根據使用者環境,自行選擇pip或easy_install):pip install fabriceasy_install fabricFabric依賴第三方的setuptools、Crypto、paramiko包的支援,源碼安裝步驟如下:# yum&
Time of Update: 2016-11-13
標籤:python paramiko一般使用paramiko的功能就是通過ssh遠程執行命令,遠程(上傳、下載)傳輸檔案等等依賴包:/usr/local/python27/bin/pip install pycrypto下載包 paramiko#wget http://en.onlinedown.net/down/paramiko-1.7.7.1.zip#unzip paramiko-1.7.7.1.zip#cd paramiko-1.7.7.1#python setup.py
Time of Update: 2016-11-12
標籤:intern pen utf8 字母 名稱 aar nes 方式 源檔案 # Auther: Aaron
Time of Update: 2016-11-12
標籤:com ace 函數調用 instance src ... base ons 序列 目錄迭代器&產生器裝飾器Json & pickle
Time of Update: 2016-11-04
標籤:return語句 c++ 邏輯 log 匿名函數 required 不一致 重複 文法 函數 函數是組織好的,可重複使用的,用來實現單一,或相關聯功能的程式碼片段。
Time of Update: 2016-11-03
標籤:python擷取mac地址 python擷取網關地址 python擷取ip地址 “人生苦短,我用Python”。Python的高效有一部分是跟它豐富的模組分不開的。Python有很多第三方模組可以協助我們完成一些事情,減少開發時間。Python pypi庫中一個模組名字叫“netifaces”,使用C語言寫的一個第三方模組。可以:
Time of Update: 2016-10-30
標籤:creat depend auto inf running 資料庫 資料 roo load Python模組之"prettytable" 摘要:
Time of Update: 2016-10-18
我們都知道並發(不是並行)編程目前有四種方式,多進程,多線程,非同步,和協程。多進程編程在python中有類似C的os.fork,當然還有更高層封裝的multiprocessing標準庫,在之前寫過的python高可用程式設計方法http://www.cnblogs.com/hymenz/p/3488837.html中提供了類似nginx中master process和worker
Time of Update: 2016-10-19
Python開發中時間長度遇到要下載檔案的情況,最常用的方法就是通過Http利用urllib或者urllib2模組。當然你也可以利用ftplib從ftp網站下載檔案。此外Python還提供了另外一種方法requests。下面來看看三種方法是如何來下載zip檔案的:方法一:import urllib import urllib2 import requestsprint "downloading with urllib" url =
Time of Update: 2016-10-19
python開發中經常遇到報錯的情況,但是warning通常並不影響程式的運行,而且有時特別討厭,下面我們來說下如何忽略warning錯誤。在說忽略warning之前,我們先來說下如何主動產生warning錯誤,這裡用到warnings模組,看如下代碼:import warningsdef fxn(): warnings.warn("deprecated", DeprecationWarning)with warnings.catch_warnings():
Time of Update: 2016-10-17
pythonic如果翻譯成中文的話就是很python。很+名詞結構的用法在中國不少,比如:很娘,很國足,很CCTV等等。·以下為了簡略,我們用P表示pythonic的寫法,NP表示non-pythonic的寫法,當然此P-NP非彼P-NP。為什麼要追求pythonic?相比於NP,P的寫法簡練,明確,優雅,絕大部分時候執行效率高,代碼越少也就越不容易出錯。我認為好的程式員在寫代碼時,應該追求代碼的正確性,簡潔性和可讀性,這恰恰就是pythonic的精神所在。對於具有其他程式設計語言經驗而初涉Py
Time of Update: 2016-11-22
簡單談談python中的多進程,簡單python進程進程是由系統自己管理的。1:最基本的寫法from multiprocessing import Pooldef f(x): return x*xif __name__ == '__main__': p = Pool(5) print(p.map(f, [1, 2, 3]))[1, 4, 9]2、實際上是通過os.fork的方法產生進程的unix中,所有進程都是通過fork的方法產生的。multiprocessing
Time of Update: 2016-11-22
Python中的日期時間處理詳解,python詳解Python中關於時間、日期的處理庫有三個:time、datetime和Calendar,其中datetime又有datetime.date、datetime.time、datetime.datetime三個類。而時間又可以分為時間戳記、本地時間和UTC時間(世界標準時間)。是不是聽起來有點亂?那麼他們相互之間有什麼區別?有什麼聯絡?又如何轉換呢?time模組在time模組中,時間有三種表現形式:時間戳記,一般指Unix時間戳記,是從1970年開
Time of Update: 2016-10-25
Python環境搭建,python搭建1、在www.python.org下載安裝Python 2、python -m pip install --upgrade pip 3、安裝常用庫:numpy、scipy、matplotlibpip install numpypip install scipypip install matplotlib 4、opencv庫的安裝:複製C:\opencv_2.4.9\build\python\2.7\x86\cv2.pyd到C:\
Time of Update: 2016-10-20
Python內建函數(7)——bytearray,pythonbytearray英文文檔:class bytearray([source[, encoding[, errors]]]) Return a new array of bytes. The bytearray class is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of
Time of Update: 2016-10-20
django model去掉unique_together報錯的解決方案,djangomodelunique事情是這樣的,我有一個儲存考試的表class Exam(models.Model): category = cached_fields.ForeignKeyField(Category) name = models.CharField(max_length=128) date = models.DateField() created_at =
Time of Update: 2016-10-20
深入淺析ImageMagick命令執行漏洞,淺析imagemagick00 前言什麼是ImageMagick?ImageMagick是一個功能強大的開源圖形處理軟體,可以用來讀、寫和處理超過90種的圖片檔案,包括流行的JPEG、GIF、