diff --git a/clients/py/tests/test_integration.py b/clients/py/tests/test_integration.py index f03f9232..2e480b57 100644 --- a/clients/py/tests/test_integration.py +++ b/clients/py/tests/test_integration.py @@ -174,7 +174,7 @@ def compare_dfs(df1, df2, backend): col2 = df2[name].sort_index() assert len(col1) == len(col2), \ '{}: column {} size mismatch'.format(backend, name) - if col1.dtype == np.float: + if col1.dtype == float: ok = np.allclose(col1.values, col2.values) else: ok = col1.equals(col2) diff --git a/clients/py/tests/test_pbutils.py b/clients/py/tests/test_pbutils.py index 87794ed3..d36416e1 100644 --- a/clients/py/tests/test_pbutils.py +++ b/clients/py/tests/test_pbutils.py @@ -28,7 +28,7 @@ def test_encode_df(): df = pd.read_csv('{}/weather.csv'.format(here)) df['STATION_CAT'] = df['STATION'].astype('category') - df['WDF2_F'] = df['WDF2'].astype(np.float) + df['WDF2_F'] = df['WDF2'].astype(float) msg = pbutils.df2msg(df, labels) names = [col.name for col in msg.columns] diff --git a/clients/py/v3io_frames/pbutils.py b/clients/py/v3io_frames/pbutils.py index 069485fb..e8534732 100644 --- a/clients/py/v3io_frames/pbutils.py +++ b/clients/py/v3io_frames/pbutils.py @@ -232,7 +232,7 @@ def series2col_with_dtype(s, name, dtype): elif dtype == fpb.FLOAT: kw['dtype'] = fpb.FLOAT kw['floats'] = s - elif dtype == fpb.STRING: # Pandas dtype for str is object + elif dtype == fpb.STRING: kw['strings'] = s kw['dtype'] = fpb.STRING elif dtype == fpb.BOOLEAN: @@ -263,7 +263,7 @@ def series2col(s, name): elif is_float(s.dtype): kw['dtype'] = fpb.FLOAT kw['floats'] = s - elif s.dtype == np.object: # Pandas dtype for str is object + elif s.dtype == object: kw['strings'] = s kw['dtype'] = fpb.STRING elif is_bool(s.dtype): @@ -278,7 +278,7 @@ def series2col(s, name): kw['times'] = s.astype(np.int64) kw['dtype'] = fpb.TIME elif is_categorical_dtype(s.dtype): - # We assume catgorical data is strings + # We assume categorical data is strings kw['strings'] = s.astype(str) kw['dtype'] = fpb.STRING else: @@ -297,7 +297,7 @@ def insert_nulls_based_on_null_values_map(df, null_values): for col_name in null_values[i].nullColumns: # boolean columns should be converted to `object` to be able to # represent None. - if df[col_name].dtype == np.bool and \ + if df[col_name].dtype == bool and \ col_name not in casted_columns: casted_columns[col_name] = True df[col_name] = df[col_name].astype(object)