User Portlet User Portlet

Discussions
QuantityMagnitude and QuantityUnit work on Quantity objects as follows[mcode]In[3]:= QuantityMagnitude[Quantity[1.21346`, "Kilograms"/"Meters"^3]] Out[3]= 1.21346 In[8]:= QuantityUnit[Quantity[1.21346`, "Kilograms"/"Meters"^3]] Out[8]=...
Cases takes a level specification as its 3rd argument, Cases[expr, patttern, levelspec]. The (documented) default for levelspec is {1}. Therefore, the following returns {} In[27]:= Cases[y^2, _Power] Out[27]= {}   Cases looks at only level 1 for...
Chad, I am assuming that the result you desire is {"dog", "cat", "bird", "bird"} In[1]:= Fold[DeleteCases[#1, #2, {1}, 1] &, data, sub] Out[1]= {"dog", "cat", "bird", "bird"}and putting another cat in the "sub" list we get[mcode]data =...
#[[1]][#[[2]]] & /@ Transpose[{heads, arguments}]
Cases[set1, _ -> "green"]tells Cases to replace expressions matching_(any Mathematica expression) with "green". That is the way Cases works. But what you want is to find cases of occurrence of the pattern [mcode](_ ->...
# is Slot[1] so its first part is 1. Its second part, that is #[[2]], does not exist. I do not understand the nature of the replacement rules but something similar to this could be what you are looking for. [mcode]In[1]:= ((Evaluate[({r0 X, r1 Y, r1...