Questions tagged [insert]
26 questions
2
votes
1 answer
Find missing values in time series and fill them with Na
I have this list
list = {{1, 3}, {3, 7}};
representing a time series from t = 1 to t = 4.
How would I go about filling the missing values so that my list looks like this in the end:
list = {{1, 3}, {2,Na}, {3, 7}, {4,Na}};
Of course, the length…
Sulli
- 2,185
- 14
- 28
1
vote
2 answers
Conditional Insert Into a List of Lists
When importing tabular data as Import["URL","Data"], it is often the case that Mathematica will skip returning values for tables in which an entry in the table is blank. For example, in importing some election results from…
Stuart Poss
- 1,883
- 9
- 17
0
votes
0 answers
Mathematica "Insert" not working
Why doesn't this work:
mergeList[a_, b_] := (
list = a;
Insert[list, 98, 3];
Do[
Do[
(
If[
b[[f]] < list[[s]],
(Insert[list, b[[f]], s]; Break[])
]
),
{s, Length[list]}
],
{f, Length[b]}
];
…
kukac67
- 111
- 2