I've got a two column table (Fields, Methods) and I'd like to find which Methods relates to many Fields. Can I accomplish this task using Mathematica?
This are the sample data. https://jpst.it/L6I5
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI've got a two column table (Fields, Methods) and I'd like to find which Methods relates to many Fields. Can I accomplish this task using Mathematica?
This are the sample data. https://jpst.it/L6I5
I'm not fully sure what you're asking for, but do these ideas help?
data = Import["https://justpaste.it/wiaz", "Data"][[1, 2]];
#[[1, 2]] -> #[[All, 1]] & /@ GatherBy[data, Last]
{
"DrawOdds_Main(PrintPageEventArgs,Boolean)" ->
{"_drawMarkets", "_lastPrintedSport", "_noPrint", "_pageHeight",
"_pageIndex", "_pageWidth", "_personalTemplate",
"_previousPrintingStatus", "_printingStatus", "_printRows",
"_rowIndex", "_sportIndex", "_sports", "_tournamentPrintingData",
"Settings"},
"AltreCondizioniDiStampa(List,List,Int32,PrintRowOrder)" ->
{"_rowIndex", "_tournamentPrintingData"},
"Init(List,Dictionary<AggregateSport,List>)" ->
{"Settings", "_printDialog", "_printDocument",
"_personalTemplate", "_sports", "_printRows"},
"InitPrinter()" ->
{"_printDocument", "_pageHeight", "_pageWidth", "_personalTemplate"},
"InizializzaMisureTemplate(PersonalTemplate)" ->
{"_personalTemplate"},
"Print(Int32)" ->
{"_printDialog", "_printDocument", "_printerSettingsToPage", "_printerSettingsFromPage"},
"PrintPreview()" ->
{"_printerSettingsToPage", "_printerSettingsFromPage", "_pageIndex",
"_pageHeight", "_pageWidth"},
"Reset()" ->
{"_rowIndex", "_sportIndex", "_noPrint", "_drawMarkets"},
"UpdateNextPageParam(PrintPageEventArgs)" ->
{"_printerSettingsToPage", "_printerSettingsFromPage",
"_pageIndex", "_noPrint", "_drawMarkets"},
"UpdatePrintingStatus(AggregateSport,List)" ->
{"_rowIndex", "_tournamentPrintingData", "_lastPrintedSport",
"_printingStatus", "_previousPrintingStatus"}
}
Alternatively you could use GroupBy[data, Last]
.
Or maybe you're wanting to visualize it as a network?
Graph[DirectedEdge @@@ Reverse /@ data, VertexLabels -> Placed["Name", Tooltip]]
Tally[]
.. $\endgroup$ – Feyre Jul 21 '16 at 15:39