"Master Tips_1.gif"

"Master Tips_2.gif"

"Master Tips_3.gif"

"Master Tips_4.gif"

"Master Tips_5.gif"

"Master Tips_6.gif"

"Master Tips_7.gif"

"Master Tips_8.gif"

"Master Tips_9.gif"

"Master Tips_10.gif"

"Master Tips_11.gif"

"Master Tips_12.gif"

"Master Tips_13.gif"

"Master Tips_14.gif"

"Master Tips_15.gif"

"Master Tips_16.gif"

"Master Tips_17.gif"

Make a Table of Contents

"Master Tips_18.gif"

"Master Tips_19.gif"

Average and Standard Deviation for a Table or Spreadsheet

Module to find the average  and std deviation of a list of values. The list above (yvalues) is essentially a table or spreadsheet - here we will find the average and std deviation for each column of data:

"Master Tips_20.gif"

"Master Tips_21.gif"

"Master Tips_22.gif"

"Master Tips_23.gif"

"Master Tips_24.gif"

"Master Tips_25.gif"

"Master Tips_26.gif"

"Master Tips_27.gif"

"Master Tips_28.gif"

There is an easier way to do this : Here we sum a column

"Master Tips_29.gif"

"Master Tips_30.gif"

Here we sum a row:

"Master Tips_31.gif"

"Master Tips_32.gif"

Create a Table with Column and Row Headings

"Master Tips_33.gif"

Grade Number Per Cent
A 25 14.0
A- 10   5.6
B+ 14   7.8
B 10   5.6
B- 13   7.3
C+ 12   6.7
C 3   1.7
C- 6   3.4
D+ 10   5.6
D 8   4.5
F 68 38.0

Create a Graph with Text for the data points

This applies different sized labels to the plot

"Master Tips_34.gif"

"Master Tips_35.gif"

Emulate the VLOOKUP Function from Spreadsheets

How do you sum a specific column in a table, with filter critera? Here, we find all the unique values in the first column, and sum the desired column (basically a VLOOKUP in Excel.

a = {{a1, b1}, {a2, b2}, {a2, b3}, {a2, b4}, {a3, b5}, {a3, b6}};

You can use : els = Union@Part[Transpose@a, 1]
sel[x_] := Select[a, (#[[1]] == x) &];
Map[sel[#] &, els]
Map[{#[[1, 1]], Total@Transpose[#][[2]]} &, %]

Explanation : The first line finds the different first elements (e.g.{a1, a2, a3})

The function sel[x_] selects the rows of a which have x as their first
element.Then the first Map applies this function for the different first
elements : {a1, a2, a3}

Then the second Map constructs your final matrix with the different
elements in the first column and the sum in the second column.

"Master Tips_36.gif"

"Master Tips_37.gif"

"Master Tips_38.gif"

"Master Tips_39.gif"

Calculate Number of Days between Dates

"Master Tips_40.gif"

"Master Tips_41.gif"

Miscellaneous Functions

"Master Tips_42.gif"

"Master Tips_43.gif"

"Master Tips_44.gif"

"Master Tips_45.gif"

"Master Tips_46.gif"

"Master Tips_47.gif"

"Master Tips_48.gif"

Import Tab - separated Data into a Formatted Grid

"Master Tips_49.gif"

Sort an Array of Arrays by Column (position)

"Master Tips_50.gif"

"Master Tips_51.gif"

"Master Tips_52.gif"

"Master Tips_53.gif"

Graphs

"Master Tips_54.gif"

Create a Histogram

"Master Tips_55.gif"

"Master Tips_56.gif"

"Master Tips_57.gif"

"Master Tips_58.gif"

Another way :

"Master Tips_59.gif"

"Master Tips_60.gif"

Sum a Specific Column, Conditionally

"Master Tips_61.gif"

"Master Tips_62.gif"

"Master Tips_63.gif"

"Master Tips_64.gif"

"Master Tips_65.gif"

"Master Tips_66.gif"

"Master Tips_67.gif"

"Master Tips_68.gif"

"Master Tips_69.gif"

"Master Tips_70.gif"

Playing with Text as DataPoints, Varying Size

"Master Tips_71.gif"

"Master Tips_72.gif"

"Master Tips_73.gif"

"Master Tips_74.gif"

"Master Tips_75.gif"

"Master Tips_76.gif"

"Master Tips_77.gif"

"Master Tips_78.gif"

Tooltips and Rollovers

"Master Tips_79.gif"

"Master Tips_80.gif"

Select a subset of rows from a list based upon a list of criteria chosen by the user.

I'm working on a small application and I'm searching for a way to  
Select a subset of rows from a list based upon a list of criteria  
chosen by the user.  Here is small (hypothetical) example. Say one  
has a data set of consisting of a list of as follows:

{ {1,A,Blue,"Hello",10.5},{7,D,Green,"Goodbye",9.4},
{6,S,Yellow,"Hello",6.9},{3,A,Blue,"Hello",8.0}}

The user will specify a letter and a color and the program should  
Select[ ] the appropriate rows, e.g., if I pick Color=Blue and Letter  
= A, then it will return

{ {1,A,Blue,"Hello",10.5},{3,A,Blue,"Hello",8.0}....}, etc.  Thus one  
can enter Select[myData,(#[[2]]==A && #[[3]]==Blue)&] and get the  
appropriate records.Note that The actual data set has about 20,000  
records (lists), each with about 20 fields, and can select 7 or 8  
different attributes, so the Select statements get fairly long.

My question involves an efficient way to code the Select statement if  
a user wants to chose records that correspond to any value of a  
particular field, e.g., All of the Color=Blue, regardless of the  
Letter choice,e.g.,

Select[myData,(#[[3]]==Blue)&]

More precisely, is there a way to pass Select the user choice of any  
letter using some sort of 'wildcard' value that represents any value  
for the specific attribute, i.e.,

  Select[myData,(#[[2]]=='Wildcard' && #[[3]]==Blue)&]

My motivation is that if I have may possible selection criteria, I  
can still use a single Select statement. Hi, try MatchQ[#[[3]], Blue] if you wist to select Blue
and MatchQ[#[[3]], _] as the wildcard.And
to make it more easy

try MatchQ[#[[3]],Blue] if you wist to select Blue
and MatchQ[#[[3]],_] as the wildcard. And
to make it more easy

mypattern={_,_,_,_,_};
...
If[characterSelectedQ,mypattern[[2]]=selectedCharacter];
If[colorSelectedQ,mypattern[[3]]=selectedColor];
...
Select[lst,MatchQ[#,mypattern] &]

"Master Tips_81.gif"

"Master Tips_82.gif"

"Master Tips_83.gif"

"Master Tips_84.gif"

This works

"Master Tips_85.gif"

"Master Tips_86.gif"

What to do with missing values in a list

"Master Tips_87.gif"

Select Rows based on Criteria - Method 1

"Master Tips_88.gif"

Select Rows based on Criteria - Method 2

"Master Tips_89.gif"

End


Created by Wolfram Mathematica 6.0  (02 June 2008) Valid XHTML 1.1!