- Hands-On Data Science and Python Machine Learning
- Frank Kane
- 120字
- 2021-07-15 17:15:00
Post colon
Now if I put the colon on the other side of the 3, that says I want everything after 3, so 3 and after. If I say x[3:], that's giving me the third element, 0, 1, 2, 3, and everything after it. So that's going to return 4, 5, and 6 in that example, OK?
x[3:]
The output is as follows:
[4, 5, 6]
You might want to keep this IPython/Jupyter Notebook file around. It's a good reference, because sometimes it can get confusing as to whether the slicing operator includes that element or if it's up to or including it or not. So the best way is to just play around with it here and remind yourself.
推薦閱讀
- 深入理解Bootstrap
- PyTorch自動駕駛視覺感知算法實戰
- 軟件界面交互設計基礎
- HoloLens Beginner's Guide
- MongoDB for Java Developers
- 微服務設計原理與架構
- INSTANT Mercurial SCM Essentials How-to
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Visual C#.NET程序設計
- Java EE核心技術與應用
- 計算機應用基礎項目化教程
- HTML5+CSS3+JavaScript 從入門到項目實踐(超值版)
- ASP.NET 4.0 Web程序設計
- 大數據時代的企業升級之道(全3冊)
- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)