- Learning pandas(Second Edition)
- Michael Heydt
- 99字
- 2021-07-02 20:37:09
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.
推薦閱讀
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- Java Web基礎與實例教程(第2版·微課版)
- Web Development with Django Cookbook
- 零基礎學Java(第4版)
- Internet of Things with Intel Galileo
- 大學計算機基礎(第2版)(微課版)
- Salesforce Reporting and Dashboards
- The Professional ScrumMaster’s Handbook
- 深度學習原理與PyTorch實戰(第2版)
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)
- Webpack實戰:入門、進階與調優(第2版)
- Instant jQuery Boilerplate for Plugins
- 從Excel到Python數據分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應用
- Node.js應用開發
- 計算思維與Python編程