<legend id='V7dA7'><style id='V7dA7'><dir id='V7dA7'><q id='V7dA7'></q></dir></style></legend>

    <tfoot id='V7dA7'></tfoot>

  1. <small id='V7dA7'></small><noframes id='V7dA7'>

  2. <i id='V7dA7'><tr id='V7dA7'><dt id='V7dA7'><q id='V7dA7'><span id='V7dA7'><b id='V7dA7'><form id='V7dA7'><ins id='V7dA7'></ins><ul id='V7dA7'></ul><sub id='V7dA7'></sub></form><legend id='V7dA7'></legend><bdo id='V7dA7'><pre id='V7dA7'><center id='V7dA7'></center></pre></bdo></b><th id='V7dA7'></th></span></q></dt></tr></i><div id='V7dA7'><tfoot id='V7dA7'></tfoot><dl id='V7dA7'><fieldset id='V7dA7'></fieldset></dl></div>

      <bdo id='V7dA7'></bdo><ul id='V7dA7'></ul>
    1. 如何在 Python 中使用 Pandas 创建一系列数字

      时间:2023-11-08
          • <bdo id='fKljy'></bdo><ul id='fKljy'></ul>

                <tbody id='fKljy'></tbody>

            1. <legend id='fKljy'><style id='fKljy'><dir id='fKljy'><q id='fKljy'></q></dir></style></legend>
              <i id='fKljy'><tr id='fKljy'><dt id='fKljy'><q id='fKljy'><span id='fKljy'><b id='fKljy'><form id='fKljy'><ins id='fKljy'></ins><ul id='fKljy'></ul><sub id='fKljy'></sub></form><legend id='fKljy'></legend><bdo id='fKljy'><pre id='fKljy'><center id='fKljy'></center></pre></bdo></b><th id='fKljy'></th></span></q></dt></tr></i><div id='fKljy'><tfoot id='fKljy'></tfoot><dl id='fKljy'><fieldset id='fKljy'></fieldset></dl></div>
            2. <tfoot id='fKljy'></tfoot>

              <small id='fKljy'></small><noframes id='fKljy'>

              1. 本文介绍了如何在 Python 中使用 Pandas 创建一系列数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是 python 新手,最近学会了使用 Pandas 在 python 中创建一个系列.我可以定义一个系列,例如: x = pd.Series([1, 2, 3, 4, 5]) 但是如何定义一个范围的系列,比如 1 到 100 而不是全部输入从 1 到 100 的元素?

                I am new to python and have recently learnt to create a series in python using Pandas. I can define a series eg: x = pd.Series([1, 2, 3, 4, 5]) but how to define the series for a range, say 1 to 100 rather than typing all elements from 1 to 100?

                推荐答案

                见 pandas.Series 的文档,您的 data 参数只需要一个 类数组、字典或标量值.因此,要为范围创建系列,您可以执行与为范围创建列表完全相同的操作.

                As seen in the docs for pandas.Series, all that is required for your data parameter is an array-like, dict, or scalar value. Hence to create a series for a range, you can do exactly the same as you would to create a list for a range.

                one_to_hundred = pd.Series(range(1,101))
                

                这篇关于如何在 Python 中使用 Pandas 创建一系列数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 Matplotlib 中设置颜色图的范围 下一篇:如何用 Python 的“范围"计数

                相关文章

                • <bdo id='bLh1u'></bdo><ul id='bLh1u'></ul>

                <small id='bLh1u'></small><noframes id='bLh1u'>

                    <legend id='bLh1u'><style id='bLh1u'><dir id='bLh1u'><q id='bLh1u'></q></dir></style></legend>
                    <tfoot id='bLh1u'></tfoot>
                  1. <i id='bLh1u'><tr id='bLh1u'><dt id='bLh1u'><q id='bLh1u'><span id='bLh1u'><b id='bLh1u'><form id='bLh1u'><ins id='bLh1u'></ins><ul id='bLh1u'></ul><sub id='bLh1u'></sub></form><legend id='bLh1u'></legend><bdo id='bLh1u'><pre id='bLh1u'><center id='bLh1u'></center></pre></bdo></b><th id='bLh1u'></th></span></q></dt></tr></i><div id='bLh1u'><tfoot id='bLh1u'></tfoot><dl id='bLh1u'><fieldset id='bLh1u'></fieldset></dl></div>