Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15462 > unrolled thread
| Started by | "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> |
|---|---|
| First post | 2013-09-18 01:27 +0000 |
| Last post | 2013-09-18 10:25 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
R: ReplacePart -> eliminate "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> - 2013-09-18 01:27 +0000
Re: R: ReplacePart -> eliminate Helen Read <readhpr@gmail.com> - 2013-09-18 10:25 +0000
| From | "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> |
|---|---|
| Date | 2013-09-18 01:27 +0000 |
| Subject | R: ReplacePart -> eliminate |
| Message-ID | <l1avhp$cue$1@smc.vnet.net> |
Great!
Many thanks Alexei!
Now I have the following list of couples
y = Table[{n, 1/(3 - n)}, {n, 0, 5}]
{{0, 1/3}, {1, 1/2}, {2, 1}, {3, ComplexInfinity}, {4, -1}, {5, -(1/2)}}
The command
Select[y, {NumberQ[#], NumberQ[#]} &]
does not work. How can I modify your suggestion in order to eliminate the non-numerical couple {3,ComplexInfinity}
from the list (avoiding Transpose etc..)?
Rob.
-----Messaggio originale-----
Da: Alexei Boulbitch [mailto:Alexei.Boulbitch@iee.lu]
Inviato: marted=EC 17 settembre 2013 09:09
A: mathgroup@smc.vnet.net
Cc: Brambilla Roberto Luigi (RSE)
Oggetto: Re: ReplacePart -> eliminate
I'd like to eliminate the Indeterminate (or other non-numerical terms, as Infinite, etc...) items. Es.
x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
0.628319, -0.628319, 1.25664, Indeterminate};
or
x=Table[1/(3 - n), {n, 0, 5}])
{1/3, 1/2, 1, ComplexInfinity, -1,-1/2}
How can I do it with a simple command?
Many thanks, Roberto
Hi, Roberto,
Try this:
x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
0.628319, -0.628319, 1.25664, Indeterminate}; y = Table[1/(3 - n), {n, 0, 5}];
Select[x, NumberQ[#] &]
Select[y, NumberQ[#] &]
{-1.25664, 0.628319, -0.628319, 1.25664, -1.25664, 0.628319, \ -0.628319, 1.25664}
{1/3, 1/2, 1, -1, -(1/2)}
Have fun, Alexei
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
RSE SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, in forza del quale l'assunzione di obbligazioni da parte della Societ=E0 avvie=
ne con firma di un procuratore, munito di idonei poteri.
RSE adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). Ac=
cording to this RSE Compliance Programme, any commitment of RSE is taken by=
the signature of one Representative granted by a proper Power of Attorney.=
Le informazioni contenute in questo messaggio di posta elettronica sono ris=
ervate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o for=
ma. Qualora Lei non fosse la persona destinataria del presente messaggio, La=
invitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazi=
one al mittente. The information included in this e-mail and any attachments=
are confidential and may also be privileged. If you are not the correct rec=
ipient, you are kindly requested to notify the sender immediately, to cancel=
it and not to disclose the contents to any other person.
[toc] | [next] | [standalone]
| From | Helen Read <readhpr@gmail.com> |
|---|---|
| Date | 2013-09-18 10:25 +0000 |
| Message-ID | <l1bv2t$fq9$1@smc.vnet.net> |
| In reply to | #15462 |
Select[y, NumberQ[#[[1]]] && NumberQ[#[[2]]] &]
Or use Cases.
Cases[y, {_?NumericQ, _?NumericQ}]
Helen Read
University of Vermont
On 9/17/2013 9:27 PM, Brambilla Roberto Luigi (RSE) wrote:
> Great!
> Many thanks Alexei!
> Now I have the following list of couples
>
> y = Table[{n, 1/(3 - n)}, {n, 0, 5}]
>
> {{0, 1/3}, {1, 1/2}, {2, 1}, {3, ComplexInfinity}, {4, -1}, {5, -(1/2)}}
>
> The command
>
> Select[y, {NumberQ[#], NumberQ[#]} &]
>
> does not work. How can I modify your suggestion in order to eliminate the non-numerical couple {3,ComplexInfinity}
> from the list (avoiding Transpose etc..)?
>
> Rob.
>
>
> -----Messaggio originale-----
> Da: Alexei Boulbitch [mailto:Alexei.Boulbitch@iee.lu]
> Inviato: marted=EC 17 settembre 2013 09:09
> A: mathgroup@smc.vnet.net
> Cc: Brambilla Roberto Luigi (RSE)
> Oggetto: Re: ReplacePart -> eliminate
>
> I'd like to eliminate the Indeterminate (or other non-numerical terms, as Infinite, etc...) items. Es.
>
>
> x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
> 0.628319, -0.628319, 1.25664, Indeterminate};
>
> or
>
> x=Table[1/(3 - n), {n, 0, 5}])
> {1/3, 1/2, 1, ComplexInfinity, -1,-1/2}
>
> How can I do it with a simple command?
> Many thanks, Roberto
>
>
> Hi, Roberto,
>
> Try this:
>
> x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
> 0.628319, -0.628319, 1.25664, Indeterminate}; y = Table[1/(3 - n), {n, 0, 5}];
>
> Select[x, NumberQ[#] &]
> Select[y, NumberQ[#] &]
>
> {-1.25664, 0.628319, -0.628319, 1.25664, -1.25664, 0.628319, \ -0.628319, 1.25664}
>
> {1/3, 1/2, 1, -1, -(1/2)}
>
> Have fun, Alexei
>
> Alexei BOULBITCH, Dr., habil.
> IEE S.A.
> ZAE Weiergewan,
> 11, rue Edmond Reuter,
> L-5326 Contern, LUXEMBOURG
>
> Office phone : +352-2454-2566
> Office fax: +352-2454-3566
> mobile phone: +49 151 52 40 66 44
>
> e-mail: alexei.boulbitch@iee.lu
>
>
>
> RSE SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, in forza del quale l'assunzione di obbligazioni da parte della Societ=E0 avvie=
> ne con firma di un procuratore, munito di idonei poteri.
> RSE adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). Ac=
> cording to this RSE Compliance Programme, any commitment of RSE is taken by=
> the signature of one Representative granted by a proper Power of Attorney.=
> Le informazioni contenute in questo messaggio di posta elettronica sono ris=
> ervate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o for=
> ma. Qualora Lei non fosse la persona destinataria del presente messaggio, La=
> invitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazi=
> one al mittente. The information included in this e-mail and any attachments=
> are confidential and may also be privileged. If you are not the correct rec=
> ipient, you are kindly requested to notify the sender immediately, to cancel=
> it and not to disclose the contents to any other person.
>
--
HPR
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web