当前位置:   article > 正文

pandas数据类型简介_note: you may need to restart the kernel to use up

note: you may need to restart the kernel to use updated packages.
pip install pandas
  • 1
Note: you may need to restart the kernel to use updated packages.Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/

Requirement already satisfied: pandas in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packages (1.0.3)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied: numpy>=1.13.3 in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packages (from pandas) (1.18.2)
Requirement already satisfied: pytz>=2017.2 in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packages (from pandas) (2019.3)
Requirement already satisfied: six>=1.5 in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.14.0)


WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\users\zcc\appdata\local\programs\python\python37\python.exe -m pip install --upgrade pip' command.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

pandas含有使数据分析变得更高效的数据结构和操作工具,基于numpy来构建

import pandas as pd
from pandas import Series,DataFrame
  • 1
  • 2

Series为一维数组对象,由一组数组和相应的标签(索引)组成,也可以当作字典来使用

#默认索引
obj = Series([1,2,3,4,5])
print(obj)
print(obj.values)
print(obj.index)
  • 1
  • 2
  • 3
  • 4
  • 5
0    1
1    2
2    3
3    4
4    5
dtype: int64
[1 2 3 4 5]
RangeIndex(start=0, stop=5, step=1)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
#自定义索引
obj = Series(['s','d','d','e'],index = [1
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/893878
推荐阅读
相关标签
  

闽ICP备14008679号