Fillna doesn't work when series object is an argument
See original GitHub issueSystem information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Modin version (
modin.__version__
): - Python version:
- Code we can use to reproduce:
import modin.pandas as pd
df = pd.DataFrame({'a': ['a'], 'b': ['b'],}, index=['row1'])
df['c'] = pd.NA
df['c'] = df['c'].fillna(df['b']) # df['c'].fillna('c') works fine
print(df)
Describe the problem
when fillna is called with series object as argument seems nothing happens while pandas does actual na replacement
Source code / logs
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
pandas fillna not working - Stack Overflow
Show activity on this post. Check this why fillna() while iterating over columns does not work. ... Commented lines seem to be working....
Read more >fillna() does not work when value parameter is a list #3435
So it appears the values in the list are used to fill the 'holes' in order, if the list has the same length...
Read more >pandas.Series.fillna — pandas 1.5.2 documentation
Fill NA /NaN values using the specified method. Value to use to fill holes (e.g. 0), alternately a dict/Series/DataFrame of values specifying which...
Read more >pandas: Replace missing values (NaN) with fillna() - nkmk note
Series as the first argument value of fillna() , missing values of the corresponding column are replaced with the mean value.
Read more >Pandas Fill NA – DataFrame.fillna() - Data Independent
Your data may have NAs (Not Available) values within your DataFrame. Think of these as blank, null, or not present values. Many pandas...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I can tell, it seems like something’s going awry in
broadcast_axis_partitions
, on this line: the value in the partition seems to be changed when the dataframe is reindexed. I’ll let someone more familiar with the codebase weigh in on why this is the case.Abridged stack trace:
_copartition
calls_join_index_objects
, which finds the common index to cast the left and right operand to, but forfillna
doesn’t need to do this (this is True for column reindexing). You can see my changes in https://github.com/modin-project/modin/pull/4674.