http://xgboost.readthedocs.org/en/latest/python/python_intro.html
在xgboost的主页(上面的链接)上,它说:要安装XGBoost,请执行以下步骤:
您需要make在项目的根目录中运行
在python-package目录下运行
python setup.py安装
但是,当我这样做时,对于步骤1,出现以下错误:make:术语"make"不被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.
然后我跳过step1并直接执行第2步,出现另一个错误:
Traceback (most recent call last):
File "setup.py", line 19, in <module>
LIB_PATH = libpath['find_lib_path']()
File "xgboost/libpath.py", line 44, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
Run Code Online (Sandbox Code Playgroud)
有谁知道如何在Windows10平台上安装xgboost for python?谢谢你的帮助!
DF:
name score
A 1
A 2
A 3
A 4
A 5
B 2
B 4
B 6
B 8
Run Code Online (Sandbox Code Playgroud)
想以下面的形式获得以下新数据框:
name count mean std min 25% 50% 75% max
A 5 3 .. .. .. .. .. ..
B 4 5 .. .. .. .. .. ..
Run Code Online (Sandbox Code Playgroud)
如何从df.describe()中提取信息并重新格式化?谢谢
如何找到数据帧每行的最频繁值?例如:
In [14]: df
Out[14]:
a b c
0 2 3 3
1 1 1 2
2 7 7 8
Run Code Online (Sandbox Code Playgroud)
回报:[3,1,7]
假设我们有一个df:
A B
apple 1.0
apple 2.0
apple NA
orange NA
orange 7.0
melon 14.0
melon NA
melon 15.0
melon 16.0
Run Code Online (Sandbox Code Playgroud)
要替换NA,我们可以使用df ["B"].fillna(df ["B"].median()),但它会用"B"中的所有数据的中位数填充NA
有没有办法可以使用某个A的中位数来代替NA(如下所示):
A B
apple 1.0
apple 2.0
apple **1.5**
orange **7.0**
orange 7.0
melon 14.0
melon **15.0**
melon 15.0
melon 16.0
Run Code Online (Sandbox Code Playgroud)
谢谢!
是否有任何方便的方法来标准化每一行的最大值(除以一行的最大值),例如:
df=
A B C
2 1 1
1 4 1
0 2 1
return:
A B C
1 0.5 0.5
0.25 1 0.25
0 1 0.5
Run Code Online (Sandbox Code Playgroud) 我试过了:
df.groupby('name').agg('count').compute(num_workers=1)
df.groupby('name').agg('count').compute(num_workers=4)
Run Code Online (Sandbox Code Playgroud)
他们花相同的时间,为什么num_workers不起作用?
谢谢
df1 有缺失值:
df1=
ID age
1 12
2 na
3 23
4 na
5 na
6 na
Run Code Online (Sandbox Code Playgroud)
我还有另一个df:
df2=
ID age
2 4
4 5
5 6
6 7
Run Code Online (Sandbox Code Playgroud)
我想要fillna的df1,使用df2,基于相同的ID:
df1 (after fillna)=
ID age
1 12
2 4
3 23
4 5
5 6
6 7
Run Code Online (Sandbox Code Playgroud) 想要拥有可以在字符串中的子字符串之后找到数字的函数,例如:
>>> find_number('abc123de34','e')
34
>>> find_number('abc123de34','de')
34
Run Code Online (Sandbox Code Playgroud)
最好的方法是什么?
python ×7
pandas ×6
dataframe ×5
numpy ×4
python-2.7 ×2
dask ×1
installation ×1
python-3.x ×1
regex ×1
string ×1
xgboost ×1