Thanks for the rensponse.
I modified the code as suggested by you, but this time I got a new error as show below.
Code I tried
combined_updated.iloc[:,‘institute_service’] = combined_updated[‘institute_service’].astype(‘str’)
Error Msg
ValueErrorTraceback (most recent call last)
in ()
5 # combined.notnull().sum()
6 combined_updated = combined.dropna(axis=1,thresh=500)
----> 7 combined_updated.iloc[:,‘institute_service’] = combined_updated[‘institute_service’].astype(‘str’)
8 combined_updated[‘institute_service’]
9 # print(combined_updated)
/dataquest/system/env/python3/lib/python3.4/site-packages/pandas/core/indexing.py in setitem(self, key, value)
191 else:
192 key = com._apply_if_callable(key, self.obj)
–> 193 indexer = self._get_setitem_indexer(key)
194 self._setitem_with_indexer(indexer, value)
195
/dataquest/system/env/python3/lib/python3.4/site-packages/pandas/core/indexing.py in _get_setitem_indexer(self, key)
169 if isinstance(key, tuple):
170 try:
–> 171 return self._convert_tuple(key, is_setter=True)
172 except IndexingError:
173 pass
/dataquest/system/env/python3/lib/python3.4/site-packages/pandas/core/indexing.py in _convert_tuple(self, key, is_setter)
240 if i >= self.obj.ndim:
241 raise IndexingError(‘Too many indexers’)
–> 242 idx = self._convert_to_indexer(k, axis=i, is_setter=is_setter)
243 keyidx.append(idx)
244 return tuple(keyidx)
/dataquest/system/env/python3/lib/python3.4/site-packages/pandas/core/indexing.py in _convert_to_indexer(self, obj, axis, is_setter)
1848
1849 raise ValueError("Can only index by location with a [s]"
-> 1850 self._valid_types)
1851
1852
ValueError: Can only index by location with a [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array]