如何在linux机器上运行conda?
我安装了Anaconda,可以运行Python,所以我假设我正确安装了它.
按照本指南:http: //docs.continuum.io/conda/intro.html,我正在尝试安装Python33,所以我正在复制并将以下行粘贴到我的控制台中:
conda create -n py33 python=3.3 anaconda
Run Code Online (Sandbox Code Playgroud)
但是,这给了我一个错误:
-bash: conda: command not found
Run Code Online (Sandbox Code Playgroud)
运行Conda需要做什么?
我在这里使用熊猫来分析大数据文件:http://www.nielda.co.uk/betfair/data/它们的大小约为100兆.
来自csv的每个负载需要几秒钟,然后有更多时间来转换日期.
我已经尝试加载文件,将日期从字符串转换为日期时间,然后将它们重新保存为pickle文件.但加载它们也需要几秒钟.
我可以使用哪些快速方法从磁盘加载/保存数据?
使用Numpy/Python,是否可以从单个函数调用返回均值和方差?
我知道我可以单独进行,但平均值需要计算样本标准偏差.因此,如果我使用单独的函数来获得均值和方差,我会添加不必要的开销.
我曾尝试在这里查看numpy文档(http://docs.scipy.org/doc/numpy/reference/routines.statistics.html),但没有成功.
我有一个数据帧:
pe_odds[ [ 'EVENT_ID', 'SELECTION_ID', 'ODDS' ] ]
Out[67]:
EVENT_ID SELECTION_ID ODDS
0 100429300 5297529 18.00
1 100429300 5297529 20.00
2 100429300 5297529 21.00
3 100429300 5297529 22.00
4 100429300 5297529 23.00
5 100429300 5297529 24.00
6 100429300 5297529 25.00
Run Code Online (Sandbox Code Playgroud)
当我使用groupby和agg时,我得到了一个多索引的结果:
pe_odds.groupby( [ 'EVENT_ID', 'SELECTION_ID' ] )[ 'ODDS' ].agg( [ np.min, np.max ] )
Out[68]:
amin amax
EVENT_ID SELECTION_ID
100428417 5490293 1.71 1.71
5881623 1.14 1.35
5922296 2.00 2.00
5956692 2.00 2.02
100428419 603721 2.44 2.90
4387436 4.30 6.20
4398859 …Run Code Online (Sandbox Code Playgroud) 我正在使用PyDev.
我正在尝试将项目类组织成包.
例如,在文件夹中,我在/libraries/fund_price_library.py上有一个模块
在我项目的另一个文件中,我尝试使用以下方法导入:
from libraries.fund_price_library import FundPriceLibrary as fpl
Run Code Online (Sandbox Code Playgroud)
PyDev用红色标出"FundPriceLibrary as fpl",用这个错误标记它:
unresolved import fpl
Run Code Online (Sandbox Code Playgroud)
但是,我的脚本工作得很好,所以我相信我正在进行正确的导入.
我的项目中有很多类似的错误,看起来很乱.但是,我的python代码工作,所以我假设我正确导入.
如何抑制这些错误?
如何在http://seller.samsungapps.com/中提交新应用时选择类别?
在类别菜单下,我看到的是"主要类别"或"银河特价"
当我选择主类别时,我没有子菜单,它不会让我提交游戏
如果我选择Galaxy Specials\Other,它会告诉我:
The registered binaries do not meet the category conditions for GALAXY Specials. The GALAXY Specials category can be selected only if at least one binary supports GALAXY Specials. You can go to ‘Binary>Advanced Mode>Binary Details’ to check the supported GALAXY Specials options.
Run Code Online (Sandbox Code Playgroud)
那么,我该如何提交游戏呢?
我相信我已经在我的Debian版本上安装了pygraphviz.如果我从命令行运行Python,我可以导入它:
jon@debian:~/anaconda3/bin$ ipython
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:17:45)
Type "copyright", "credits" or "license" for more information.
IPython 4.1.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import pygraphviz
In [2]:
Run Code Online (Sandbox Code Playgroud)
但是,如果我从PyCharm中的Python控制台尝试相同的操作,我会收到此错误:
/home/jon/anaconda3/bin/python /home/jon/apps/pycharm-community-5.0.4/helpers/pydev/pydevconsole.py 59089 41751
Python 3.5.1 |Anaconda 2.5.0 (32-bit)| (default, Dec 7 2015, 11:17:45)
Type "copyright", "credits" …Run Code Online (Sandbox Code Playgroud) 我有一个带有nans的数据帧:
>>>df.head()
Out[1]:
JPM US SMALLER COMPANIES C ACC
1990-01-02 NaN
1990-01-03 NaN
1990-01-04 NaN
1990-01-05 NaN
1990-01-08 NaN
Run Code Online (Sandbox Code Playgroud)
我有另一个数据框,其中包含值:
>>>t.head()
Out[1]:
1990-01-02 51.95
1990-01-03 52.63
1990-01-04 53.04
1990-01-05 52.07
1990-01-08 51.73
Name: JPM US SMALLER COMPANIES C ACC, dtype: float64
Run Code Online (Sandbox Code Playgroud)
不幸的是,df.fillna似乎不适合我:
>>>df.fillna( t ).head()
Out[1]:
JPM US SMALLER COMPANIES C ACC
1990-01-02 NaN
1990-01-03 NaN
1990-01-04 NaN
1990-01-05 NaN
1990-01-08 NaN
[5 rows x 1 columns]
Run Code Online (Sandbox Code Playgroud)
为什么会这样?我在熊猫0.13.1上
当我运行此代码时:
from sklearn import cross_validation
bs = cross_validation.Bootstrap(9, random_state=0)
Run Code Online (Sandbox Code Playgroud)
我收到了这个弃用警告:
C:\Anaconda\envs\p33\lib\site-packages\sklearn\cross_validation.py:684: DeprecationWarning: Bootstrap will no longer be supported as a cross-validation method as of version 0.15 and will be removed in 0.17
"will be removed in 0.17", DeprecationWarning)
Run Code Online (Sandbox Code Playgroud)
我应该使用什么而不是引导程序?
除了使用一组或语句
isinstance( x, np.float64 )或isinstance( x, np.float32 )或isinstance( np.float16 )
是否有更简洁的方法来检查变量是浮动类型?
python ×8
pandas ×3
anaconda ×2
numpy ×2
aggregate ×1
conda ×1
graphviz ×1
group-by ×1
multi-index ×1
pycharm ×1
pydev ×1
pygraphviz ×1
python-3.x ×1
scikit-learn ×1