Commit 58a4387e by alejandro77palacios

Función: filtrar red por grupo de estímulos junto con sus respuestas asociadas

parent d63b7646
...@@ -24,3 +24,10 @@ def obtener_respuestas_asociadas(red, *estimulos): ...@@ -24,3 +24,10 @@ def obtener_respuestas_asociadas(red, *estimulos):
for estimulo in estimulos: for estimulo in estimulos:
respuestas_asociadas += list(red.neighbors(estimulo)) respuestas_asociadas += list(red.neighbors(estimulo))
return respuestas_asociadas return respuestas_asociadas
def filtrar_red_por_estimulos(red, *estimulos):
respuestas_asociadas = obtener_respuestas_asociadas(red, *estimulos)
estimulos_y_respuestas = respuestas_asociadas + list(estimulos)
red_filtrada = red.subgraph(estimulos_y_respuestas).copy()
return red_filtrada
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment