Can't apply Differences[] to a SparseArray[]?
- To: mathgroup at smc.vnet.net
- Subject: [mg99312] Can't apply Differences[] to a SparseArray[]?
- From: jmay <jason.may at gmail.com>
- Date: Sat, 2 May 2009 06:01:10 -0400 (EDT)
Mathematica newbie here. I'd like to apply the Differences[] function to a sparse array. Other list operations appear to work, but I'm seeing this: s = SparseArray[{5, 6, 7} -> {10, 11, 12}] Differences[s] Differences::list: List expected at position 1 in Differences [SparseArray[Automatic,{7},0,{1,{{0,3},{{5},{6},{7}}},{10,11,12}}]]. What is special about Differences? I don't want to convert the sparse array to a regular list; my data set could have thousands or millions of missing elements. Thanks, -Jason
- Follow-Ups:
- Re: Can't apply Differences[] to a SparseArray[]?
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Can't apply Differences[] to a SparseArray[]?