sassoftware / sassoftware/python-swat
fillna() on CAS column not working
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 159
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
If I create a CAS table with missing values...
import pandas as pd
import numpy as np
df = pd.DataFrame(dict(amount=[35,40], tip=[3.5,np.nan]))
tbl = conn.upload_frame(df, casout=dict(name="test", caslib="casuser", replace=True))
...the .fillna() method does not replace the missing values:
tbl2 = tbl
tbl2['test'] = tbl2['tip].fillna(0)
tbl3 = tbl
tbl3['test'] = tbl3['tip'].fillna(0, inplace=True)
Is there any workaround? In this case, I want to add amount with tip and save the result in total_amount:
tbl['total_amount'] = tbl['amount'] + tbl['tip'].fillna(0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fillna() behavior on the CAS column in the upload_frame example, comparing the assignment and inplace forms shown in the issue. Reproduce the missing tip value, then verify that filling it with 0 allows amount and tip to produce total_amount.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, pandas, python
- Domain
- data, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100