[go: up one dir, main page]

Items tagged with selectremove

Feed App Center

Hello. I am trying to use the Remove() command to remove a column of a dataframe. I applied the command like its shown in the help section and I get an error. I don't see how I am applying this command incorrectly. Where am I going wrong? Below is a screenshot of the error output and the .mw file used to generate the output.

Remove_a_column_from_a_dataframe.mw

How do I get the susset that contains unknowns on the rhs of the elements?

restart

 

# I need this subset {a=1/sqrt(2+A), b=6*sqrt(4+N),  d=5*H}

 

C:={a=1/sqrt(2+A),b=6*sqrt(4+N) ,c=sqrt(7),d=5*H,,e=-12,f=-96}

{a = 1/(2+A)^(1/2), b = 6*(4+N)^(1/2), c = 7^(1/2), d = 5*H, e = -12, f = -96}

(1)

selectremove(has,indets(rhs~(C)),C)

{}, {A, H, K, N, 1/(2+A)^(1/2), (4+N)^(1/2)}

(2)

selectremove(has,lhs~(C)=indets(rhs~(C)),C)

() = (), {a, b, c, d, e} = {H, K, N, (4+N)^(1/2)}

(3)
 

 

Download 2024-06-05_Q_Select_Remove_indet_elements.mw

I need help trying to remove some null elements from a listlist, that i converted from an Array. 

Example: I have a list of coordinates r:=[[1,2],[1,3]], which i converted to an array, and nulled the first element.

r:=convert(r,Array): 
r[1]:=NULL:
r:=convert(r,listlist):

I now have r=[[],[1,3]] after converting it back to a listlist. How do i remove the first element, which is an empty entry, such that i end up with r=[[1,3]]

Thanks 

If I have a list say 

L:=[1,"2","3",4,5,"6",7,8,9,"10"]

Now i would like to have fuction which takes L as input say    split(L)

and would return two list one with characters from that namely ["2","3","6","10"] and another of integers [1,4,5,7,8,9] like this 

The list will have characters and integers only

Kind help it will be acknowleged

When doing

item:=x;
res:=remove(has,item,x);

Maple returns, as expected

But when item is not a single symbol, say sin(x) or diff(y(x),x), then it no longer returns ()

item:=diff(y(x),x);
res:=remove(has,item,diff(y(x),x));

It does not return () but it now returns the input itself, as if it was not removed.

Why is that, and how to make it return () also on composite expression?  I tried flatten and inplace option. Otherwise, I will have to do a special test before. 

The strange thing is that it works on 

item:=2*diff(y(x),x);
res:=remove(has,item,diff(y(x),x));

Now it returns as expected. So now it did remove diff(y(x),x). But it does not remove it when it is on its own. I assume this is by design. But it is not intuitive to the user. One would expect it to work same way on removing `x` or `sin(x)` or `diff(y(x),x)`

I have a list of 1's and 2's. Something like [1,1,1,2,2,2]. I want to remove 1 or 2 from the list (only once), without needing to mention at which place. The remove command removes all of the occurrences, I need something similar which remove the given element only once.
>L:[1,1,1,2]
>remove(has, L, 1)
[2]

I want the output to be [1,1,2]

Hi,

I try to remove first column from my df variable, but the command Remove(df,1) don't work. Ideas ?

Thanks

SérieTabulateStat.mw

Hello

Since my solutions are neither efficient nor concise, I wonder if someone could help me with the following problem. Suppose

 

L:=[[[],[],3,2,1,4],[1,4,[],5,8,[]],[5,6,7,8,[],1]]:

(Just a short and simplified version - L is a huge list). I need the elements to be rearranged as follows

newL:=[[1,5],[4,6],[3,7],[2,5,8],[1,8],[4,1]]:

that is, the first sublist of newL contains the first elements of all sublists of L without [], the second sublist of newL contains the second elements of all sublists of L without [] and so on.  

How can that be achieved without seq and remove?

Many thanks

Ed

PS. My solution 

newL:=[seq(remove(y->y=[],map(x->x[i],L)),i=1..nops(L[1]))]

The size of the sublists does not change.  

Dear friends, please I would like to ask for your help with an odd problem I have using the remove command. 

I have an array 

A:=Array([1,4,1,7]);

and I need to remove its first element A[1]. 

A:= remove[flatten](x -> x = A[1], A);

Instead of getting the result  A:= [4 1 7] I get  A:=[4 7], and I can't understand why. 

Could you please help me with a solution to the problem? Many thanks for the help.  

 

I want to separate  the derivative and non-derivative (the part other than  derivative) terms from the following (shown in figure) equations by using maple commands or code. Kindly help me. Thanks in advance. 

 

I wanted to remove entry from a list that contain y=y or x=x in it. Here is an example

f:= (x-1)*y^4/(x^2*(2*y^2-1));
S:=[singular(f)]

Where I wanted to remove those entries highlighted above to obtain

This is below how I ended up doing it. I'd like to ask if there is a better or more elegent way. I had to use map, since could not get remove() to work on the original list in one shot. 

foo:= z->remove(has,z,{y = y,x = x});
map(foo,[singular(f)])

Which gives the output above.

Is there a better way to do this? I always learn when I find how to do something better.

Maple 2019.1

 

 

How do I remove infinity from a list

s:=[f(x) , exp(a), GAMMA(2x)-1 , infinity , 1, -infinity]

remove(has,%,infinity)

does not work.

It should yield

s:=[f(x) , exp(a), GAMMA(2x)-1 , 1]

I have a program that produces lists of polynomails in multiple variables; I want to remove any polynomials that have the variable x[i] where i is a number.

An example list would be:
[
y[a0]-y[d0],
k[d1]*y[a1]-k[d2]*y[d2],
k[d1]*y[a1]*x[1]-k[d2]*y[d2]*x[2],
]
 

Hi

How can I remove a subset containing a number from a partition?

eg S := [seq(2..5)]

P:=combinat:-setpartition(S, 2);

[[[2, 3], [4, 5]], [[2, 4], [3, 5]], [[2, 5], [3, 4]]]

I want to remove any partition involving 5

leaving

[[[2, 3]], [[2, 4]], [[3, 4]]]

i tried

remove(has,P,5)

 

 

I'm using Maple 17 to seperate a large set of equations. I used selectremove command but the problem is it cannot return to zero when I select a varuable whish is not appear in this equation (it's showed on the figure below)!
Thanks!

1 2 Page 1 of 2