There should be a problem with your data, not pandas. Example below:
>>> data = [['a', 'b', ''], ['', 'e', 'f']]
>>> df = pd.DataFrame(data)
>>> df
0 1 2
0 a b
1 e f
If you try to replace ''with np.nanin the above example, you will get the desired result:
>>> df.replace('', np.nan)
0 1 2
0 a b NaN
1 NaN e f
However, if you do not accidentally provide your details:
>>> data = [['a', 'b', None], [None, 'e', 'f']]
>>> df = pd.DataFrame(data)
>>> df
0 1 2
0 a b None
1 None e f
pandascannot help, since your data does not contain empty lines, but no given values ( None):
>>> df.replace('', np.nan)
0 1 2
0 a b None
1 None e f
However, there is still a chance that you can remove Nonefrom your table. The following, as dumb as it seems, should work:
>>> df.replace(np.nan, np.nan)
0 1 2
0 a b NaN
1 NaN e f
, , , .