- Learning pandas(Second Edition)
- Michael Heydt
- 109字
- 2021-07-02 20:37:11
Explicit lookup by labels with .loc[]
Lookup by label can also be achieved by using the .loc[] property:

There are no problems using integer labels:

Note that .loc[] has a different behavior than .iloc[] when passing an index label that is not in the index. In that case, pandas will return a NaN value instead of throwing an exception:

What is NaN? We will see this in more detail later in the chapter, but pandas uses it for the representation of missing data or numbers that can't be found through index lookups. It also has ramifications in various statistical methods that we will also examine later in this chapter.
推薦閱讀
- TypeScript入門與實戰
- Android開發精要
- Java游戲服務器架構實戰
- Mastering Ubuntu Server
- Learning Laravel 4 Application Development
- 游戲程序設計教程
- Android系統級深入開發
- Java實戰(第2版)
- 圖數據庫實戰
- .NET 4.5 Parallel Extensions Cookbook
- Java Web從入門到精通(第2版)
- 遠方:兩位持續創業者的點滴思考
- SQL Server 2014 Development Essentials
- 面向物聯網的Android應用開發與實踐
- Programming MapReduce with Scalding