4

I tried theis solution But it didn't really solve my problem

x = ['a', 'b', 'c', 'd', 'e', 'f']
y = np.array(['10', '20', '30', '40', '50', '60'])
z = np.array(['x', 'y', 'z', 'f', 'b', 's'])
df_vaex = vaex.from_arrays(x=x, y=y, z=z)

df_vaex.y = df_vaex.y.astype('float64')
print(df_vaex.dtypes) 

output

x    <class 'str'>
y    <class 'str'>
z    <class 'str'>
dtype: object


how can I convert columns of string to numeric? Thanks.

salwaen
  • 81
  • 1
  • 6

1 Answers1

4

I found the solution https://github.com/vaexio/vaex/issues/944

df_vaex['y'] = df_vaex.y.astype('float64')

salwaen
  • 81
  • 1
  • 6