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

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.
主站蜘蛛池模板: 水城县| 乌拉特中旗| 吉木乃县| 大渡口区| 上林县| 牟定县| 邢台县| 大城县| 西藏| 远安县| 繁昌县| 泰顺县| 万荣县| 米易县| 南丹县| 峡江县| 阿图什市| 晴隆县| 甘南县| 大宁县| 潜江市| 育儿| 哈巴河县| 洮南市| 崇明县| 天门市| 拉萨市| 沛县| 衡阳市| 克拉玛依市| 济阳县| 米易县| 正宁县| 苏尼特右旗| 武夷山市| 郴州市| 滨州市| 开平市| 绥江县| 普兰店市| 宁陵县|