0

I am doing the basic Data Exploration with 2 fields Outlet Type :

array(['Supermarket Type1', 'Grocery Store', 'Supermarket Type3',
       'Supermarket Type2'], dtype=object) 

Outlet_Size :

array(['Medium', nan, 'Small', 'High'], dtype=object)

I have found out few insights as follows : If Outlet_Type is Grocery store, it is always a small Outlet_Size.

I want to use this information to fill some of the Nan's in Outlet_size where Outlet_type = Grocery store.

Can someone help me , how do I use if Condition in Fillna ?

  • Welcome to StackOverflow. Please take the time to read this post on [how to provide a great pandas example](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) may also be useful. – jezrael Feb 09 '17 at 15:35

1 Answers1

0
df.iloc[np.where(df.Outlet_type == 'Grocery Store'), 'Outlet_Size'] = 'Small'
A.Kot
  • 7,615
  • 2
  • 22
  • 24