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

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.

主站蜘蛛池模板: 贡觉县| 安化县| 通江县| 宜春市| 高唐县| 连江县| 高淳县| 治多县| 白朗县| 贡嘎县| 汝阳县| 宁德市| 望江县| 乌什县| 县级市| 凤城市| 武威市| 大庆市| 岳阳市| 曲周县| 红原县| 涿鹿县| 来凤县| 尉犁县| 富锦市| 山丹县| 同仁县| 定襄县| 屏山县| 台南市| 九寨沟县| 太白县| 泽库县| 石景山区| 琼海市| 五莲县| 娱乐| 蒙城县| 广宁县| 喀什市| 大同县|