1 |
1 |
<span role="presentation"><span class="cm-keyword">import</span> <span class="cm-variable">pandas</span> <span class="cm-keyword">as</span> <span class="cm-variable">pd</span></span> |
1 |
<span role="presentation"></span><span role="presentation"></span> |
1 |
<span role="presentation"><span class="cm-variable">index</span> = [<span class="cm-string">"cup"</span>, <span class="cm-string">"chair"</span>, <span class="cm-string">"table"</span>, <span class="cm-string">"kagaku"</span>, <span class="cm-string">"pictre"</span>]</span> |
1 |
<span role="presentation"><span class="cm-variable">data</span> = [7012, 9406, 9609, <span class="cm-number">12</span>, 3824,9701]</span> |
1 |
<span role="presentation"></span> |
1 |
<span role="presentation"><span class="cm-comment"># indexとdataを含むSeriesを作成しseriesに代入</span></span> |
1 |
<span role="presentation"><span class="cm-variable">series</span> = <span class="cm-variable">pd</span>.<span class="cm-property">Series</span>(<span class="cm-variable">data</span>,<span class="cm-variable">index</span>=<span class="cm-variable">index</span>)</span> |
1 |
<span role="presentation"></span> |
1 |
<span role="presentation"><span class="cm-builtin">print</span>(<span class="cm-variable">series</span>)</span> |
コメントを残す