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

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.

主站蜘蛛池模板: 怀化市| 福贡县| 海城市| 安溪县| 二连浩特市| 布尔津县| 湟源县| 青州市| 阿克苏市| 信宜市| 嵊州市| 邻水| 南昌市| 贵定县| 洪洞县| 宜春市| 西和县| 东海县| 腾冲县| 延边| 柳林县| 循化| 临夏县| 衡水市| 沁阳市| 内江市| 武威市| 福泉市| 大理市| 新晃| 镇雄县| 老河口市| 云浮市| 南漳县| 大冶市| 亳州市| 海城市| 浑源县| 科尔| 班戈县| 汉川市|