熊猫时区转换

问题:

我有一个数据框作为示例:

df:

a   b                      c      d
1   2020-01-20 01:00:00    32     jajskdn
2   NaN                    23     2aksn
3   2020-05-20 02:00:00    asjn   sdn
4   NaN                    sd     cas
7   NaN                    nf     cka

I m trying to apply tz_convert as below

df[b] = df[b].dt.tz_convert['America/New_York']

I'm getting below error as we have NaN values in the dataframe:

Attribute Error: 'NoneType' object has no attribute 'tz_convert'

如何通过处理空值解决以上问题?