我正在寻找解决方案来加速我编写的函数来循环遍历pandas数据帧并比较当前行和前一行之间的列值.
例如,这是我的问题的简化版本:
User Time Col1 newcol1 newcol2 newcol3 newcol4
0 1 6 [cat, dog, goat] 0 0 0 0
1 1 6 [cat, sheep] 0 0 0 0
2 1 12 [sheep, goat] 0 0 0 0
3 2 3 [cat, lion] 0 0 0 0
4 2 5 [fish, goat, lemur] 0 0 0 0
5 3 9 [cat, dog] 0 0 0 0
6 4 4 [dog, goat] 0 0 0 0
7 4 11 [cat] 0 0 …Run Code Online (Sandbox Code Playgroud) 我想知道是否有人遇到过类似的问题并找到了解决方案?我正在尝试在Mac OS X 10.10.2上为Python 2.7.9 Anaconda 2.2.0安装igraph。
我设法brew install homebrew/science/igraph确定,但是当我尝试pip install python-igraph以下错误时:
grep: /usr/lib/libiconv.la: No such file or directory
sed: /usr/lib/libiconv.la: No such file or directory
libtool: link: `/usr/lib/libiconv.la' is not a valid libtool archive
make[3]: *** [libigraph.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Extracting igraph-0.7.1.tar.gz...
Configuring igraph...
Could not download and compile the C core of igraph.
----------------------------------------
Command "/Users/Angela/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/x5/_j73bjsn10b5q1y_z904g3n40000gn/T/pip-build-nR59Ui/python-igraph/setup.py';exec(compile(getattr(tokenize, …Run Code Online (Sandbox Code Playgroud)