Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float_index_to_time_index: ValueError: Invalid value NaN (not a number) #16

Open
lkorczowski opened this issue Jan 16, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@lkorczowski
Copy link
Collaborator

The following error happens, seemingly randomly (!), when I load a eeg file in script_RASR_comparison() and try to convert the index using the float_index_to_time_index function. Sometimes the script works perfectly fine start to begin and sometimes I got this error.

/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/pyxdf/pyxdf.py:578: RuntimeWarning: invalid value encountered in greater
  threshold_samples * stream.tdiff))
Warning : Channel description is empty
Traceback (most recent call last):
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-58dd86da87e9>", line 1, in <module>
    runfile('/Volumes/Ext/git/timeflux_rasr/notebooks/script_RASR_comparison.py', wdir='/Volumes/Ext/git/timeflux_rasr/notebooks')
  File "/Applications/PyCharm CE with Anaconda plugin.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/Applications/PyCharm CE with Anaconda plugin.app/Contents/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Volumes/Ext/git/timeflux_rasr/notebooks/script_RASR_comparison.py", line 61, in <module>
    df_eeg_raw = float_index_to_time_index(df_eeg_raw)
  File "/Volumes/Ext/git/timeflux_rasr/utils/utils.py", line 202, in float_index_to_time_index
    df.index = df.index.map(datetime.utcfromtimestamp)
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4881, in map
    new_values = super()._map_values(mapper, na_action=na_action)
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/pandas/core/base.py", line 1300, in _map_values
    new_values = map_f(values, mapper)
  File "pandas/_libs/lib.pyx", line 2228, in pandas._libs.lib.map_infer
ValueError: Invalid value NaN (not a number)
@lkorczowski lkorczowski added the bug Something isn't working label Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant