class_docstr: Test behaviour of the learn_dynamic_structure of `from_pandas_dynamic`
class_docstr_tok: ["Test","behaviour","of","the","learn_dynamic_structure","of","`","from_pandas_dynamic","`"]
docstr: If a == -b always, there should be an edge a->b or b->a with coefficient close to minus one
docstr_tok: ["If","a","==","-b","always",",","there","should","be","an","edge","a-",">","b","or","b-",">","a","with","coefficient","close","to","minus","one"]
code: def test_inverse_relationships_get_negative_weight(self):
      """If a == -b always, there should be an edge a->b or b->a with coefficient close to minus one"""
  
      np.random.seed(17)
      data = pd.DataFrame(
          [[el, -el] for el in np.random.choice(100, size=500)],
          columns=["a", "b"],
      )
      sm = from_pandas_dynamic(data, p=1, w_threshold=0.1)
      edge = (
          sm.get_edge_data("b_lag0", "a_lag0")
          or sm.get_edge_data("a_lag0", "b_lag0")
      )["weight"]
      assert -1.01 < edge <= -0.99
  
imports: import re
  import networkx
  import numpy
  import pandas
  import pytest
  from causalnex.structure.dynotears import from_numpy_dynamic, from_pandas_dynamic
label_desc: Use image node_id 15 for calling the TestFromPandasDynotears obj's underlying member method code with example usage: obj.test_inverse_relationships_get_negative_weight() without return types