Basic Examples (5)
Basic Examples
(5)
Summarize a vector of numbers:
In[1]:=
Out[1]=
1 column 1 | ||||||||||||
|
———
Summarize a matrix of strings and specify the column names:
In[1]:=
sarr=Transpose[{RandomChoice[CharacterRange["A","Z"],20],RandomWord["CommonWords",20]}];[sarr,{"random letter","random word"}]
Out[1]=
,
1 random letter | ||||||||||||||
|
2 random word | ||||||||||||||
|
———
Summarize a vector of numbers with missing values:
In[1]:=
Out[1]=
1 column 1 | ||||||||||||||
|
———
Summarize a full 2D array with numerical and categorical columns (numbers, strings, and symbols):
In[1]:=
Block[{n=200},arr=Flatten/@Transpose[{RandomReal[{-10,10},{n,2}],MapAt[ToLowerCase,RandomChoice[CharacterRange["A","Z"],{n,2}],{All,2}],RandomChoice[{,,Γ},n]}]];
In[2]:=
Out[2]=
,
,
,
,
1 column 1 | ||||||||||||
|
2 column 2 | ||||||||||||
|
3 column 3 | ||||||||||||||
|
4 column 4 | ||||||||||||||
|
5 column 5 | ||||||
|
Summarize a dataset:
In[3]:=
Out[3]=
,
,
,
,
1 | ||||||||||||
|
2 | ||||||||||||
|
3 | ||||||||||||||
|
4 | ||||||||||||||
|
5 | ||||||
|
Summarize a dataset with column names:
In[4]:=
ds=Dataset[arr][All,AssociationThread[{"num1","num2","char1","char2","symb"},#]&];
In[5]:=
Out[5]=
,
,
,
,
1 num1 | ||||||||||||
|
2 num2 | ||||||||||||
|
3 char1 | ||||||||||||||
|
4 char2 | ||||||||||||||
|
5 symb | ||||||
|
———
Summarize an association of vectors:
In[1]:=
asc=AssociationThread[Range[10]Table[Append[RandomReal[1,2],RandomWord[]],10]];
In[2]:=
Out[2]=
,
,
1 column 1 | ||||||||||||
|
1 column 1 | ||||||||||||
|
2 column 2 | ||||||||||||
|
3 column 3 | ||||||||||||||
|
Scope (4)
Scope
(4)
Options (7)
Options
(7)
Applications (3)
Applications
(3)
Possible Issues (7)
Possible Issues
(7)
Neat Examples (1)
Neat Examples
(1)