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

fix type error caused by: df[mask] = 0 #2141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liuslevis
Copy link

When mask is all False, pandas will raise TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value.

Reproduce when import csvdir_equities from a .csv file, like below:

date,time,close,high,low,match,open,volume,turnover,matchitems
2018/04/04,2018/4/04,172.07,172.41,166.13,172.07,166.88,24573593,0,0
2018/04/05,2018/4/05,172.57,176.56,171.17,172.57,175.48,18250947,0,0

When `mask` is all `False`, pandas will raise TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value.

Reproduce when import csvdir_equities from a .csv file, like below:

```
date,time,close,high,low,match,open,volume,turnover,matchitems
2018/04/04,2018/4/04,172.07,172.41,166.13,172.07,166.88,24573593,0,0
2018/04/05,2018/4/05,172.57,176.56,171.17,172.57,175.48,18250947,0,0
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

Successfully merging this pull request may close these issues.

1 participant