<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 创建一系列数字

      How to create a series of numbers using Pandas in Python(如何在 Python 中使用 Pandas 创建一系列数字)
          • <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 创建一系列数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)
                • <bdo id='bLh1u'></bdo><ul id='bLh1u'></ul>

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

                    <tbody id='bLh1u'></tbody>
                      <legend id='bLh1u'><style id='bLh1u'><dir id='bLh1u'><q id='bLh1u'></q></dir></style></legend>
                      <tfoot id='bLh1u'></tfoot>
                      • <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>