7分钟
离散化
1. 连续数据常常会被离散化或者拆分成面元bin
。可以通过pandas.cut()
函数来实现:
pandas.cut(x, bins, right=True, labels=None, retbins=False, precision=3,
include_lowest=False)
2. 另外一个划分的函数是:
pandas.qcut(x, q, labels=None, retbins=False, precision=3)
1. 连续数据常常会被离散化或者拆分成面元bin
。可以通过pandas.cut()
函数来实现:
pandas.cut(x, bins, right=True, labels=None, retbins=False, precision=3,
include_lowest=False)
2. 另外一个划分的函数是:
pandas.qcut(x, q, labels=None, retbins=False, precision=3)
Copyright © 2013-2024 Tencent Cloud.All Rights Reserved. 腾讯云 版权所有
学员评价