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

TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value #9

Open
saulobritto opened this issue Aug 10, 2020 · 8 comments
Assignees

Comments

@saulobritto
Copy link

Hi,

I'm usign this tool to predict ROI in zebrafish videos. I'm analysing about 66 videos. In some of them, I got this error when Load the DLC File. Do you have any idea what is going on? Am I doing something wrong?

##################
test1920
1920
top_left_X 0
im_width 1920
1920
top_left_X 0
im_width 1920
1920
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "C:\Windows\System32\DLC_ROI_tool\MousePositionTracker.py", line 194, in bodyparts_to_ROI
My_ROI_df[truth_array]=ROI[1]['ROI']
File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3482, in setitem
self._setitem_frame(key, value)
File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3528, in _setitem_frame
self._check_inplace_setting(value)
File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\generic.py", line 5304, in _check_inplace_setting
raise TypeError(
TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value
###################

Thank you in advance for your support.

@PolarBean
Copy link
Owner

hmm interesting ill look into this now.

@PolarBean
Copy link
Owner

Can you please send me the DLC file that is causing this error so i can replicate and fix?

@PolarBean
Copy link
Owner

[email protected]

@PolarBean PolarBean self-assigned this Aug 13, 2020
@natalier11
Copy link

Hi there,
I am having this same error. I've used the ROI tool successfully in the past but I am getting this error now when trying to load the DLC file associated with my video. Let me know if there has been any headway on this issue. My email is [email protected], thank you!

@Idavr
Copy link

Idavr commented Jun 10, 2021

Hello!
I am also having the same error when using the .h5 file. If it helps, when using the .csv file I get this error:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\managers.py", line 1675, in create_block_manager_from_blocks
make_block(
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\blocks.py", line 2742, in make_block
return klass(values, ndim=ndim, placement=placement)
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\blocks.py", line 142, in init
raise ValueError(
ValueError: Wrong number of items passed 9, placement implies 10

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "C:\Users\idavalik\DLC_ROI_tool\MousePositionTracker.py", line 129, in bodyparts_to_ROI
My_ROI_df=pd.DataFrame(np.zeros(X_data.shape),columns=mylist)
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\frame.py", line 558, in init
mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy)
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\construction.py", line 238, in init_ndarray
return create_block_manager_from_blocks(block_values, [columns, index])
File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\managers.py", line 1687, in create_block_manager_from_blocks
raise construction_error(tot_items, blocks[0].shape[1:], axes, e)
ValueError: Shape of passed values is (54787, 9), indices imply (54787, 10)

Please let me know if there has been an update to this issue! Either here or on my e-mail: [email protected]. Thank you for your time!

@sannatitus
Copy link

I am also having this same error... If anyone has found a solution, I would really appreciate some advice at [email protected] :)

@anacastropsico
Copy link

I have same error... (before I need changele short, because this erro: C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py:7134: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version
of pandas will change to not sort by default.

To accept the future behavior, pass 'sort=False'.

To retain the current behavior and silence the warning, pass 'sort=True'.

after this erro is show...
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "C:\Users\anaca\Downloads\programas_de_rastreio\DLC\DLC_ROI_tool-master\MousePositionTracker.py", line 132, in bodyparts_to_ROI
My_ROI_df[truth_array]=ROI[1]['ROI']
File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3482, in setitem
self._setitem_frame(key, value)
File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3528, in _setitem_frame
self._check_inplace_setting(value)
File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\generic.py", line 5304, in _check_inplace_setting
raise TypeError(
TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value

@PolarBean
Copy link
Owner

Make sure you're using the version of pandas specified in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants