Having issues in converting dataframe to Bipartite graph [on hold]












0












$begingroup$


I have 2 columns which are in dataframe and need to be converted to Bipartite grpah. I am facing issues to do that.



My data looks like this:



Col1 Col2



9d7051e2611cebdb758f1c7bd09360ac da48d74993ef5eb46acae826a33fe922



I tried this method to convert this dataframe to bipartite graph:



Method#1



`G = nx.from_pandas_edgelist(df_train, source='Donor ID', target='Project ID', edge_attr=True, create_using=None)



Method#2
'G = nx.Graph()
G.add_nodes_from(df_train['Donor ID'], bipartite=0)
G.add_nodes_from(df_train['Project ID'], bipartite=1)
G.add_edges_from(
[(row['Donor ID'], row['Project ID']) for idx, row in df_train.iterrows()])`



Though if I verify if this above conversion works using -




bipartite.is_bipartite(G)




, it gives me FALSE.



Its False for both the methods.



Not sure what I am missing here. Any help on the same would be appreciated.




Few things which I tried to resolve the issue:





  1. Find duplicate records (col1+col2) and removed duplicate ones

  2. Make sure there are no missing values in both the table so that it confirms that there is an edge for every record.

  3. When I tried with a subset of records out of 1Million records, it worked.
    So as I understand its because of some faulty data but how to find all faulty records and how to fix it is challenging.

  4. The data type is Object. Tried to convert it to string but not able to do so.
    Any help will be appreciated.


Nothing above helped.



Please guide me what I am missing here or how can I further debug the issue.










share|improve this question









New contributor




Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$



put on hold as unclear what you're asking by Sean Owen 1 hour ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.























    0












    $begingroup$


    I have 2 columns which are in dataframe and need to be converted to Bipartite grpah. I am facing issues to do that.



    My data looks like this:



    Col1 Col2



    9d7051e2611cebdb758f1c7bd09360ac da48d74993ef5eb46acae826a33fe922



    I tried this method to convert this dataframe to bipartite graph:



    Method#1



    `G = nx.from_pandas_edgelist(df_train, source='Donor ID', target='Project ID', edge_attr=True, create_using=None)



    Method#2
    'G = nx.Graph()
    G.add_nodes_from(df_train['Donor ID'], bipartite=0)
    G.add_nodes_from(df_train['Project ID'], bipartite=1)
    G.add_edges_from(
    [(row['Donor ID'], row['Project ID']) for idx, row in df_train.iterrows()])`



    Though if I verify if this above conversion works using -




    bipartite.is_bipartite(G)




    , it gives me FALSE.



    Its False for both the methods.



    Not sure what I am missing here. Any help on the same would be appreciated.




    Few things which I tried to resolve the issue:





    1. Find duplicate records (col1+col2) and removed duplicate ones

    2. Make sure there are no missing values in both the table so that it confirms that there is an edge for every record.

    3. When I tried with a subset of records out of 1Million records, it worked.
      So as I understand its because of some faulty data but how to find all faulty records and how to fix it is challenging.

    4. The data type is Object. Tried to convert it to string but not able to do so.
      Any help will be appreciated.


    Nothing above helped.



    Please guide me what I am missing here or how can I further debug the issue.










    share|improve this question









    New contributor




    Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$



    put on hold as unclear what you're asking by Sean Owen 1 hour ago


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.





















      0












      0








      0





      $begingroup$


      I have 2 columns which are in dataframe and need to be converted to Bipartite grpah. I am facing issues to do that.



      My data looks like this:



      Col1 Col2



      9d7051e2611cebdb758f1c7bd09360ac da48d74993ef5eb46acae826a33fe922



      I tried this method to convert this dataframe to bipartite graph:



      Method#1



      `G = nx.from_pandas_edgelist(df_train, source='Donor ID', target='Project ID', edge_attr=True, create_using=None)



      Method#2
      'G = nx.Graph()
      G.add_nodes_from(df_train['Donor ID'], bipartite=0)
      G.add_nodes_from(df_train['Project ID'], bipartite=1)
      G.add_edges_from(
      [(row['Donor ID'], row['Project ID']) for idx, row in df_train.iterrows()])`



      Though if I verify if this above conversion works using -




      bipartite.is_bipartite(G)




      , it gives me FALSE.



      Its False for both the methods.



      Not sure what I am missing here. Any help on the same would be appreciated.




      Few things which I tried to resolve the issue:





      1. Find duplicate records (col1+col2) and removed duplicate ones

      2. Make sure there are no missing values in both the table so that it confirms that there is an edge for every record.

      3. When I tried with a subset of records out of 1Million records, it worked.
        So as I understand its because of some faulty data but how to find all faulty records and how to fix it is challenging.

      4. The data type is Object. Tried to convert it to string but not able to do so.
        Any help will be appreciated.


      Nothing above helped.



      Please guide me what I am missing here or how can I further debug the issue.










      share|improve this question









      New contributor




      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      I have 2 columns which are in dataframe and need to be converted to Bipartite grpah. I am facing issues to do that.



      My data looks like this:



      Col1 Col2



      9d7051e2611cebdb758f1c7bd09360ac da48d74993ef5eb46acae826a33fe922



      I tried this method to convert this dataframe to bipartite graph:



      Method#1



      `G = nx.from_pandas_edgelist(df_train, source='Donor ID', target='Project ID', edge_attr=True, create_using=None)



      Method#2
      'G = nx.Graph()
      G.add_nodes_from(df_train['Donor ID'], bipartite=0)
      G.add_nodes_from(df_train['Project ID'], bipartite=1)
      G.add_edges_from(
      [(row['Donor ID'], row['Project ID']) for idx, row in df_train.iterrows()])`



      Though if I verify if this above conversion works using -




      bipartite.is_bipartite(G)




      , it gives me FALSE.



      Its False for both the methods.



      Not sure what I am missing here. Any help on the same would be appreciated.




      Few things which I tried to resolve the issue:





      1. Find duplicate records (col1+col2) and removed duplicate ones

      2. Make sure there are no missing values in both the table so that it confirms that there is an edge for every record.

      3. When I tried with a subset of records out of 1Million records, it worked.
        So as I understand its because of some faulty data but how to find all faulty records and how to fix it is challenging.

      4. The data type is Object. Tried to convert it to string but not able to do so.
        Any help will be appreciated.


      Nothing above helped.



      Please guide me what I am missing here or how can I further debug the issue.







      graphs






      share|improve this question









      New contributor




      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 hour ago







      Sanguine













      New contributor




      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      SanguineSanguine

      12




      12




      New contributor




      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Sanguine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      put on hold as unclear what you're asking by Sean Owen 1 hour ago


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









      put on hold as unclear what you're asking by Sean Owen 1 hour ago


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
























          0






          active

          oldest

          votes

















          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Callistus I

          Tabula Rosettana

          How to label and detect the document text images