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

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.
主站蜘蛛池模板: 正蓝旗| 奉贤区| 平原县| 琼结县| 高雄市| 万安县| 榕江县| 南皮县| 吴江市| 乐平市| 万源市| 梁平县| 孝义市| 彰化县| 珠海市| 延吉市| 湄潭县| 拜城县| 漾濞| 淮阳县| 安康市| 如东县| 云浮市| 康平县| 泸西县| 梅河口市| 冷水江市| 宣化县| 梁山县| 迁西县| 高碑店市| 隆子县| 绍兴县| 上思县| 股票| 莒南县| 阿克| 宁津县| 阳江市| 正安县| 会宁县|