- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Basic of Python (二);Object Oriented Programming;The self;Classes;Methods;The init method;Foundations of Machine Learning;;Class And Object Variables (类和对象变量);;;Inheritance (继承);School Member;Teacher;Student;Python之特殊方法;;;;;;;;;;;;Why Use Classes;Example;Class Shape;Class Circle;;;;Input and Output;Input from user
The input() function takes a string as argument and displays it to the user. Then it waits for the user to type something and press the return key. Once the user has entered and pressed the return key, the input() function will then return that text the user has entered.
;;;;;;Exceptions (异常);;;Handling Exceptions (异常处理)
We can handle exceptions using the try…except statement. We basically put our usual statements within the try-block and put all our error handlers in the except-block.;Raising Exceptions (抛出异常)
You can raise exceptions using the raise statement by providing the name of the error/exception and the exception object that is to be thrown. The error or exception that you can raise should be a class which directly or indirectly must be a derived class of the Exception class.;;Try … Finally (try … finally语句)
Suppose you are reading a file in your program. How do you ensure that the file object is closed properly whether or not an exception was raised? This can be done using the finally block.;;;The with statement (with语句)
Acquiring a resource in the try block and subsequently releasing the resource in the finally block is a common pattern. Hence, there is also a with statement that enables this to be done in a clean manner:;numpy, scipy, matplotlib, Scikit-learn;;Numpy数组(1、数组初探);NumPy的数组中比较重要ndarray对象属性有:
ndarray.ndim:数组的维数(即数组轴的个数),等于秩。最常见的为二维数组(矩阵)。
ndarray.shape:数组的维度。为一个表示数组在每个维度上大小的整数元组。例如二维数组中,表示数组的“行数”和“列数”。ndarray.shape返回一个元组,这个元组的长度就是维度的数目,即ndim属性。
ndarray.size:数组元素的总个数,等于shape属性中元组元素的乘积。
ndarray.dtype:表示数组中元素类型的对象,可使用标准的Python类型创建或指定dtype。另外也可使用前一篇文章中介绍的NumPy提供的数据类型。
ndarray.itemsize:数组中每个元素的字节大小。例如,一个元素类型为float64的数组itemsiz属性值为8(float64占
您可能关注的文档
- python机器学习资料.docx
- 鼎捷T100_V1.0_APS管理用户手册_简体.docx
- 鼎捷T100_V1.0_采购管理用户手册_简体.docx
- 鼎捷T100_V1.0_成本管理用户手册_简体.docx
- 鼎捷T100_V1.0_固定资产用户手册_简体.docx
- 鼎捷T100_V1.0_库存管理用户手册_简体.docx
- 鼎捷T100_V1.0_料件管理用户手册_简体.docx
- 鼎捷T100_V1.0_票据资金用户手册_简体.docx
- 鼎捷T100_V1.0_系統管理用户手册_繁体.docx
- 鼎捷T100_V1.0_销售管理用户手册_简体.docx
- FAFU机器学习03-1-Introduction of Machine Learning课件.pptx
- FAFU机器学习03-2 Linear Regression课件.pptx
- FAFU机器学习04-1 Feature Extraction and Preprocessing课件.pptx
- FAFU机器学习05-1 Model Evaluation课件.pptx
- FAFU机器学习05-2 Linear Model for Classification课件.pptx
- FAFU机器学习06-1 Decision Tree课件.pptx
- FAFU机器学习07-1 kNN and Bayes课件.pptx
- FAFU机器学习08-1 Support Vector Machine课件.pptx
- FAFU机器学习08-2 Ensemble Learning课件.pptx
- FAFU机器学习09-1 Clustering Basics课件.pptx
原创力文档


文档评论(0)