hi every one,
i'm trying to use drop to select different set of information, but i don't know if there is the best way to do it. I want to select what is mark with the red arrows, i mean, only the second column and the rows that correspond to females.
I will appreciate any help
Just what I was doing! The attached file uses a select similar to Marco's. You will find it in the last section.
Hello David,
I appreciate your help, now i'm going to replicate the code with my data.
Thank you very much
What about
Part[Select[data, (#[[1]] == "1 VTS" && StringContainsQ[#[[7]], "Female"]) &], All]
Cheers,
Marco
Thanks Marco,
Unfortunately StringContainsQ is only available in Mathe 10, but i only have acces to version 9
Thank you
Hi Oscar,
the StringContainsQ is only there because the search string contains spaces etc. If you take the exact search string and "double equal" it to #[[7]] it should work, too. If you had MMA10 the StringContainsQ function is slightly better, becaus it gives the result you want and also caters for cases where spaces etc are not always entered in the same way.
Cheers, Matco
Hello Marco,
Thank you very much for your help and your explanations, i going to try to aplly the code to my data
greetings
Query makes this sort of task easy.
Vts = {{"1 VTS", 2., 2., 5., 2., 5., "Female"}, {"1 VTS", 2., 2., 5., 2., 5., "Male"}, {"1 VTS", 2., 2., 5., 2., 5., "Female"}}; Query[Select[#[[7]] == "Female" &], 2]@Vts
A slight modification will give the total.
Query[Select[#[[7]] == "Female" &] /* Total, 2]@Vts
Hello Emmerson,
I tried what you show me, but i did not work, then i realise that Query is an option only in mathematica 10 and for now i have access to mathematica 9. There is a similar option in mathematica 9?
I'll add the excel file and the notebook, probably it will help
deleted..
Vts = {{2, 1, 3, f}, {7, 1, 4, m}, {1, 4, 8, f}, {3, 4, 7, f}}; v = Select[Vts, MemberQ[#, f] &] {{2, 1, 3, f}, {1, 4, 8, f}, {3, 4, 7, f}} v[[All, 2]] {1, 4, 4}
Replace f by Female
Hello Okkes,
I was trying the code but i did not work, i think that i am doing something wrong (i am learning). I would like to add the notebook and the excel file, probably i'll understand better with the code in the notebook