157 | | if isinstance(thing,numpy.core.defmatrix.matrix) or \ |

158 | | isinstance(thing,numpy.ndarray): |

159 | | try: |

160 | | return from_numpy_matrix(thing,create_using=create_using) |

161 | | except: |

162 | | raise networkx.NetworkXError,\ |

163 | | "Input is not a correct numpy matrix or array." |

| 157 | #numpy.core.defmatrix changed to numpy.matrixlib.defmatrix |

| 158 | #in the versions 1.3.x to 1.4.x |

| 159 | |

| 160 | try: |

| 161 | #numpy-1.4.1 |

| 162 | if isinstance(thing,numpy.matrixlib.defmatrix.matrix) or \ |

| 163 | isinstance(thing,numpy.ndarray): |

| 164 | try: |

| 165 | return from_numpy_matrix(thing,create_using=create_using) |

| 166 | except: |

| 167 | raise networkx.NetworkXError,\ |

| 168 | "Input is not a correct numpy matrix or array." |

| 169 | except AttributeError: |

| 170 | #numpy-1.3.x or less |

| 171 | if isinstance(thing,numpy.core.defmatrix.matrix) or \ |

| 172 | isinstance(thing,numpy.ndarray): |

| 173 | try: |

| 174 | return from_numpy_matrix(thing,create_using=create_using) |

| 175 | except: |

| 176 | raise networkx.NetworkXError,\ |

| 177 | "Input is not a correct numpy matrix or array." |