0
Python
value[value==' ']='Unknown' .how this line work.plz explain
6 Answers
+ 3
In Python, True is 1 in index context, and False is 0 ;)
+ 1
Subash Rogers my bad: I should have said "in list index context":
https://code.sololearn.com/cR0KMt5YeEk9/?ref=app
0
If value is empty key True will hold 'Unknown' else False will hold 'Unknown' in the list value
0
Sorry i forgot to say i found that line in pandas dataframe .that was different
0
That's not impossible that Pandas use the magic method __index__ as list does for their array: RTFM to know ;)