I've got a pandas DataFrame that looks like this:
molecule species
0 a dog
1 b horse
2 c []
3 d pig
4 e []
I want to replace the []
value with NaN
using python. How can I achieve this?
For testing:
df = pd.DataFrame({
'molecule': ['a','b','c','d','e'],
'species' : ['horse','cat','[]','frog','lion']})