Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redsem
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mauricio Alejandro Prieto Palacios
redsem
Commits
de2f6314
Commit
de2f6314
authored
Feb 04, 2023
by
alejandro77palacios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Función: extraer partición de red bipartita
parent
13e20485
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/redsem/main.py
+8
-0
No files found.
src/redsem/main.py
View file @
de2f6314
...
...
@@ -7,3 +7,11 @@ def filtrar_primeras_posiciones(df, ultima=3):
filtro
=
df
[
'posicion'
]
.
isin
(
rango
)
df_filtrado
=
df
[
filtro
]
.
reset_index
(
drop
=
True
)
return
df_filtrado
def
extraer_particion
(
red
,
particion
):
assert
nx
.
bipartite
.
is_bipartite
(
red
),
'La red no es bipartita'
nodos_en_particion
=
[
n
for
n
,
d
in
red
.
nodes
(
data
=
True
)
if
d
[
'bipartita'
]
==
particion
]
if
len
(
nodos_en_particion
)
==
0
:
raise
ValueError
(
f
'No hay nodos en la partición "{particion}"'
)
return
nodos_en_particion
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment