Skip to content

numpy math or emath #122

@arefpz

Description

@arefpz

Hi,

I just started using the toolbox to find effective connectivity in EEG data. I followed all the instructions on the GitHub page to install it in the conda environment. First, there was an issue with "statsmodels" that Python couldn't import; I then installed it using conda, and the issue was resolved. However, I then received this error when trying to run the demo examples.
It looks like the error is AttributeError: module 'numpy' has no attribute 'math'. Did you mean: 'emath'?

file "/home/aref/Documents/IDTxl-1.6.0/demos/demo_multivariate_mi.py", line 21, in <module> results = network_analysis.analyse_network(settings=settings, data=data) File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/multivariate_mi.py", line 161, in analyse_network res_single = self.analyse_single_target( settings, data, targets[t], sources[t] ) File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/multivariate_mi.py", line 288, in analyse_single_target self._include_source_candidates(data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/network_inference.py", line 974, in _include_source_candidates self._include_candidates(candidates, data) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/network_inference.py", line 151, in _include_candidates significant = stats.max_statistic( ~~~~~~~~~~~~~~~~~~~^ self, ^^^^^ ...<3 lines>... conditional=self._selected_vars_realisations, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ )[0] ^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/stats.py", line 458, in max_statistic _check_permute_in_time(analysis_setup, data, n_perm) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/stats.py", line 1669, in _check_permute_in_time if not analysis_setup.settings["permute_in_time"] and not _sufficient_replications( ~~~~~~~~~~~~~~~~~~~~~~~~^ data, n_perm ^^^^^^^^^^^^ ): ^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/idtxl/stats.py", line 1535, in _sufficient_replications if np.math.factorial(data.n_replications) > n_perm: ^^^^^^^ File "/home/aref/anaconda3/envs/idtxl/lib/python3.13/site-packages/numpy/__init__.py", line 414, in __getattr__ raise AttributeError("module {!r} has no attribute " "{!r}".format(__name__, attr)) AttributeError: module 'numpy' has no attribute 'math'. Did you mean: 'emath'?

I am using Ubuntu 22.04.5
Could you please help me figure out what I need to do to fix this error?
Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions