我是第一次成立Travis-CI.我以我认为的标准方式安装scipy:
language: python
python:
- "2.7"
# command to install dependencies
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install python-numpy python-scipy python-opencv
- sudo apt-get -qq install libhdf5-serial-dev hdf5-tools
install:
- "pip install numexpr"
- "pip install cython"
- "pip install -r requirements.txt --use-mirrors"
# command to run tests
script: nosetests
Run Code Online (Sandbox Code Playgroud)
一切都在建立.但是当测试开始时,我得到了
ImportError: No module named scipy.ndimage
Run Code Online (Sandbox Code Playgroud)
更新:这是一个更直接的问题演示.
$ sudo apt-get install python-numpy python-scipy python-opencv
$ python -c 'import scipy'
Traceback (most recent call last):
File …Run Code Online (Sandbox Code Playgroud) 我想在熊猫系列上使用numpy.diff.我是对的,这是一个错误吗?或者我做错了吗?
In [163]: s = Series(np.arange(10))
In [164]: np.diff(s)
Out[164]:
0 NaN
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 NaN
In [165]: np.diff(np.arange(10))
Out[165]: array([1, 1, 1, 1, 1, 1, 1, 1, 1])
Run Code Online (Sandbox Code Playgroud)
我正在使用pandas 0.9.1rc1,numpy 1.6.1.
看起来conda改变了它今天所寻找的默认版本,因为conda install numpy scipy它目前不起作用:
$conda create numpy scipy -n test-build-issue3 --dry-run
Error: Unsatisfiable package specifications
Hint: the following combinations of packages create a conflict with the
remaining packages:
- numpy 1.7*
- scipy
Run Code Online (Sandbox Code Playgroud)
如果我提供特定版本,我可以在本地设置工作环境.
conda create numpy=1.7.1 scipy=0.13.0 pandas=0.13.0 matplotlib=1.3 PIL -n test-build --dry-run
Run Code Online (Sandbox Code Playgroud)
但是在Travis上,虽然conda报告已经安装并链接了pandas,但测试套件引发了一个ImportError:
$ nosetests --nologcapture -a '!slow'
E
(...)
ImportError: No module named pandas
Run Code Online (Sandbox Code Playgroud)
这里是完整失败构建的一个例子.
测试套件昨天正常通过.我对Travis有很多经验,但在运行和调试conda方面经验较少.有什么建议?
我有一个这样的pandas.core.series.TimeSeries名字ts:
timestamp
2013-08-11 14:23:50 0.3219
2013-08-11 14:23:49 0.3222
2013-08-11 14:19:14 0.3305
2013-08-11 00:47:15 0.3400
2013-08-11 00:47:15.001 0.3310
2013-08-11 00:47:15.002 0.3310
2013-08-10 22:38:15.003 0.3400
2013-08-10 22:38:14 0.3403
2013-08-10 22:38:13 0.3410
Run Code Online (Sandbox Code Playgroud)
该TimeSerie的索引间隔不规则。
我想ts在给定的日期时间具有的价值,例如2013-08-11 14:20:00
我只需要插值一个值,而不是整个TimeSerie
我只想在上一个索引(2013-08-11 14:23:49)和下一个索引(2013-08-11 14:19:14)之间使用线性函数对数据进行插值