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

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.
主站蜘蛛池模板: 嘉峪关市| 安多县| 儋州市| 延边| 萨嘎县| 景德镇市| 玛多县| 尼勒克县| 宁城县| 赣榆县| 浦东新区| 泰顺县| 平邑县| 阿勒泰市| 昭觉县| 琼结县| 道孚县| 乐陵市| 周宁县| 兰州市| 昆明市| 甘洛县| 安庆市| 景泰县| 临桂县| 永清县| 呼伦贝尔市| 炎陵县| 文化| 正镶白旗| 武夷山市| 夹江县| 杭锦后旗| 固始县| 平乐县| 安康市| 绥滨县| 福海县| 安顺市| 遵化市| 舞钢市|