官术网_书友最值得收藏!

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.
主站蜘蛛池模板: 侯马市| 红安县| 手游| 内黄县| 榕江县| 云龙县| 贵溪市| 中阳县| 富裕县| 化德县| 阿克苏市| 铜川市| 霍邱县| 平陆县| 卓尼县| 大庆市| 永修县| 灌阳县| 西乌珠穆沁旗| 香港| 弥勒县| 水富县| 满城县| 江陵县| 年辖:市辖区| 常熟市| 林甸县| 台东市| 宜章县| 广东省| 奉新县| 东海县| 焦作市| 洛宁县| 漳州市| 商河县| 六盘水市| 盐池县| 玛曲县| 象州县| 临朐县|