- Python數(shù)據(jù)分析入門:從數(shù)據(jù)獲取到可視化
- 沈祥壯
- 397字
- 2019-10-21 12:09:17
1.3 The Zen of Python
開始正式學(xué)習(xí)本書的最后一個準(zhǔn)備工作,便是對這門編程語言的藝術(shù)有一個了解。打開IPython,輸入import this。這些輸出的內(nèi)容要始終銘記于心。
The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
中文翻譯如下。
Python之禪 優(yōu)美勝于丑陋 明確勝于隱晦 簡單勝于復(fù)雜 復(fù)雜勝于凌亂 扁平勝于嵌套 稀疏勝于緊湊 可讀性至關(guān)重要 即便特例,也需服從以上規(guī)則 除非刻意追求,錯誤不應(yīng)跳過 面對歧義條件,拒絕嘗試猜測 解決問題的最優(yōu)方法應(yīng)該有且只有一個 盡管這一方法并非顯而易見(除非你是Python之父) 動手勝于空想 空想勝于不想 難以解釋的實現(xiàn)方案,不是好方案 易于解釋的實現(xiàn)方案,才是好方案 命名空間是個絕妙的理念,多多益善!
推薦閱讀
- SQL Server 2016 數(shù)據(jù)庫教程(第4版)
- Visual Studio 2015 Cookbook(Second Edition)
- 卷積神經(jīng)網(wǎng)絡(luò)的Python實現(xiàn)
- 文本數(shù)據(jù)挖掘:基于R語言
- 揭秘云計算與大數(shù)據(jù)
- 數(shù)據(jù)庫系統(tǒng)原理及應(yīng)用教程(第4版)
- 基于Apache CXF構(gòu)建SOA應(yīng)用
- SQL Server 2012數(shù)據(jù)庫管理教程
- Python數(shù)據(jù)分析與數(shù)據(jù)化運營
- 深入理解InfluxDB:時序數(shù)據(jù)庫詳解與實踐
- 區(qū)塊鏈+:落地場景與應(yīng)用實戰(zhàn)
- 智能與數(shù)據(jù)重構(gòu)世界
- 數(shù)據(jù)會說話:活用數(shù)據(jù)表達(dá)、說服與決策
- 數(shù)據(jù)產(chǎn)品經(jīng)理寶典:大數(shù)據(jù)時代如何創(chuàng)造卓越產(chǎn)品
- SQL Server 2012數(shù)據(jù)庫技術(shù)及應(yīng)用(第4版)