Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 RAPIDS(0.9 版本)docker 容器。如何使用 RAPIDS cuDF 执行以下操作?
df['new_column'] = df['column_name'] > condition df[['new_column']] *= 1
您可以像处理 pandas 一样执行此操作。
import cudf df = cudf.DataFrame({'a':[0,1,2,3,4]}) df['new'] = df['a'] >= 3 df['new'] = df['new'].astype('int') # could use int8, int32, or int64 # could also do (df['a'] >= 3).astype('int') df a new 0 0 0 1 1 0 2 2 0 3 3 1 4 4 1