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

Creation using a scalar value

A Series can also be created using a scalar value:

This seems like a degenerate case with the Series only having a single value. There are, however, scenarios where this is important, such as when a series is multiplied by a scalar value, like so:

Underneath the covers, pandas took the value 2 and created a Series from that scalar value with a matching index to that in s, and then performed the multiplication through alignment of the two Series. We will look at this example again in more detail later in the chapter.

主站蜘蛛池模板: 祁门县| 乐至县| 民丰县| 辉南县| 广宗县| 镇康县| 万源市| 石渠县| 会昌县| 乾安县| 华蓥市| 江阴市| 凯里市| 晋州市| 明光市| 宁晋县| 全椒县| 宜宾市| 临汾市| 方城县| 曲松县| 本溪| 辽阳市| 淮安市| 潮安县| 来凤县| 饶平县| 汝州市| 肥西县| 静安区| 梧州市| 德清县| 桃园县| 瓮安县| 安化县| 溧水县| 和田市| 陆河县| 郧西县| 内乡县| 交口县|