os-climate / financial-entity-cleaner

cleaning for entity matching
Apache License 2.0
4 stars 4 forks source link

Pytest warning due to np.nan vs. str, which will lead to future error! #11

Open DaBeIDS opened 10 months ago

DaBeIDS commented 10 months ago

In the module iso3166 the default value for _output_name is np.nan:

image

Later a string is filled. Pytest raises the following warning:

FutureWarning: Setting an item of incompatib le dtype is deprecated and will raise in a future error of pandas. Value 'USA' has dtype incompatible with float64, please explicitly cast to a compatible dtype first. new_df.loc[index, self._output_alpha3] = country_info[self._output_alpha3]

So i guess it would be better instead of np.nan maybe an empty string could make more sense to infer the type string from the beginning on.