Posts

delete zeros from a SparseArray

Image
1 Why doesn't SparseArray automatically remove zero entries? The code a = SparseArray[{2->22,3->33,5->55,7->77,11->1111,13->1313},13]; b = SparseArray[{1->11,3->33,5->55,7->77,9->99,11->1111},13]; r = DeleteCases[a-b,0] r //ArrayRules returns {{1}->-11,{3}->0,{5}->0,{7}->0,{9}->-99,{11}->0,{2}->22,{13}->1313,{_}->0} instead of {{1}->-11,{9}->-99,{2}->22,{13}->1313,{_}->0} . Is there a nice way to get rid of zero entries? For instance, if on $A!in!mathbb{Z}^{mtimes n}_2$ I perform Gaussian elimination, I use A=Mod[A,2]; , suddenly many entries are zero and I don't want to waste memory on them. Of course I could use A=SparseArray[DeleteCases[ArrayRules[A],#[[2]]==0&],{m,n}] , but it seems clumsy to use this often... Al...

How much Ethereum is used daily in gas?

Image
2 I can see from this site - https://etherscan.io/chart/gasused - the amount of gas used on the Ethereum network daily. What I cannot work out is how much ETH that corresponds to. Is there some other site that links gas-ether? Or is there a peg of gas->ether? I mean, if i take avg Gwei as 2.5 - https://ethgasstation.info/ Do i just do Eth = 2.5 * 10-9 * 35,819,000,000 = ~90 ETH But then https://etherscan.io/chart/transactionfee has the transaction fee at 308 ETH. What am i missing? Also, is that ETH "burnt" or lost, or does it get recycled back into use? gas share | improve this question edited Dec 17 at 12:31 ...