{"action":"created","issue":{"url":"https://api.github.com/repos/statsmodels/statsmodels/issues/3308","repository_url":"https://api.github.com/repos/statsmodels/statsmodels","labels_url":"https://api.github.com/repos/statsmodels/statsmodels/issues/3308/labels{/name}","comments_url":"https://api.github.com/repos/statsmodels/statsmodels/issues/3308/comments","events_url":"https://api.github.com/repos/statsmodels/statsmodels/issues/3308/events","html_url":"https://github.com/statsmodels/statsmodels/issues/3308","id":194205245,"number":3308,"title":"ValueError: zero-size array to reduction operation maximum which has no identity","user":{"login":"lmsanch","id":3156487,"avatar_url":"https://avatars.githubusercontent.com/u/3156487?v=3","gravatar_id":"","url":"https://api.github.com/users/lmsanch","html_url":"https://github.com/lmsanch","followers_url":"https://api.github.com/users/lmsanch/followers","following_url":"https://api.github.com/users/lmsanch/following{/other_user}","gists_url":"https://api.github.com/users/lmsanch/gists{/gist_id}","starred_url":"https://api.github.com/users/lmsanch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmsanch/subscriptions","organizations_url":"https://api.github.com/users/lmsanch/orgs","repos_url":"https://api.github.com/users/lmsanch/repos","events_url":"https://api.github.com/users/lmsanch/events{/privacy}","received_events_url":"https://api.github.com/users/lmsanch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-07T23:34:50Z","updated_at":"2016-12-08T00:53:35Z","closed_at":null,"body":"I am running a script that has dependencies on statsmodel. I have several matrices of about 180 rows by 50 to 500 columns. The code runs well for the matrices that have roughly 100 columns or less, but for the remaining ones, the code breaks at the point below:\r\n\r\n```\r\n51     # run the search\r\n     52     ic_algorithm = IC(RobustRegressionTest, data_frame, variable_types)\r\n---> 53     graph = ic_algorithm.search()\r\n     54     solution = graph.edges(data=True)\r\n     55 \r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/causality/inference/search/__init__.pyc in search(self)\r\n     23     def search(self):\r\n     24         self._build_g()\r\n---> 25         self._find_skeleton()\r\n     26         self._orient_colliders()\r\n     27 \r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/causality/inference/search/__init__.pyc in _find_skeleton(self)\r\n    124                 for z in itertools.combinations(z_candidates, N):\r\n    125                     test = self.independence_test([y], [x], list(z), \r\n--> 126                         self.data, self.alpha)\r\n    127                     if test.independent():\r\n    128                         self._g.remove_edge(x,y)\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/causality/inference/independence_tests/__init__.pyc in __init__(self, y, x, z, data, alpha)\r\n      4 class RobustRegressionTest():\r\n      5     def __init__(self, y, x, z, data, alpha):\r\n----> 6         self.regression = sm.RLM(data[y], data[x+z])\r\n      7         self.result = self.regression.fit()\r\n      8         self.coefficient = self.result.params[x][0]\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/robust/robust_linear_model.pyc in __init__(self, endog, exog, M, missing, **kwargs)\r\n    115         self.M = M\r\n    116         super(base.LikelihoodModel, self).__init__(endog, exog,\r\n--> 117                 missing=missing, **kwargs)\r\n    118         self._initialize()\r\n    119         #things to remove_data\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/base/model.pyc in __init__(self, endog, exog, **kwargs)\r\n     58         hasconst = kwargs.pop('hasconst', None)\r\n     59         self.data = self._handle_data(endog, exog, missing, hasconst,\r\n---> 60                                       **kwargs)\r\n     61         self.k_constant = self.data.k_constant\r\n     62         self.exog = self.data.exog\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/base/model.pyc in _handle_data(self, endog, exog, missing, hasconst, **kwargs)\r\n     82 \r\n     83     def _handle_data(self, endog, exog, missing, hasconst, **kwargs):\r\n---> 84         data = handle_data(endog, exog, missing, hasconst, **kwargs)\r\n     85         # kwargs arrays could have changed, easier to just attach here\r\n     86         for key in kwargs:\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/base/data.pyc in handle_data(endog, exog, missing, hasconst, **kwargs)\r\n    564     klass = handle_data_class_factory(endog, exog)\r\n    565     return klass(endog, exog=exog, missing=missing, hasconst=hasconst,\r\n--> 566                  **kwargs)\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/base/data.pyc in __init__(self, endog, exog, missing, hasconst, **kwargs)\r\n     73 \r\n     74         # this has side-effects, attaches k_constant and const_idx\r\n---> 75         self._handle_constant(hasconst)\r\n     76         self._check_integrity()\r\n     77         self._cache = resettable_cache()\r\n\r\n/Users/luissanchez/anaconda/lib/python2.7/site-packages/statsmodels/base/data.pyc in _handle_constant(self, hasconst)\r\n     91             # detect where the constant is\r\n     92             check_implicit = False\r\n---> 93             const_idx = np.where(self.exog.ptp(axis=0) == 0)[0].squeeze()\r\n     94             self.k_constant = const_idx.size\r\n     95 \r\n\r\nValueError: zero-size array to reduction operation maximum which has no identity\r\n```\r\nAny solution? Thanks"},"comment":{"url":"https://api.github.com/repos/statsmodels/statsmodels/issues/comments/265621172","html_url":"https://github.com/statsmodels/statsmodels/issues/3308#issuecomment-265621172","issue_url":"https://api.github.com/repos/statsmodels/statsmodels/issues/3308","id":265621172,"user":{"login":"lmsanch","id":3156487,"avatar_url":"https://avatars.githubusercontent.com/u/3156487?v=3","gravatar_id":"","url":"https://api.github.com/users/lmsanch","html_url":"https://github.com/lmsanch","followers_url":"https://api.github.com/users/lmsanch/followers","following_url":"https://api.github.com/users/lmsanch/following{/other_user}","gists_url":"https://api.github.com/users/lmsanch/gists{/gist_id}","starred_url":"https://api.github.com/users/lmsanch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmsanch/subscriptions","organizations_url":"https://api.github.com/users/lmsanch/orgs","repos_url":"https://api.github.com/users/lmsanch/repos","events_url":"https://api.github.com/users/lmsanch/events{/privacy}","received_events_url":"https://api.github.com/users/lmsanch/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T00:53:35Z","updated_at":"2016-12-08T00:53:35Z","body":"Thank you. I have version 0.6.1. I have no idea what the problem is, and a somebody else I know is having the same problem with a different part of my dataset."}}
{"actor":{"display_login":"lmsanch"}}