Use `withColumn`. It will replace a column if you give it the same name.
On Tue, Jun 21, 2016 at 4:16 AM, pseudo oduesp <[email protected]>
wrote:
> Hi ,
> with fillna we can select some columns to perform replace some values
> with chosing columns with dict
> {columns :values }
> but how i can do same with cast i have data frame with 300 columns and i
> want just cats 4 from list columns but with select query like that :
>
> df.select(columns1.cast(int),columns2.cast(int),columns3.cast(int))
>
> but i loose other columns
> how i can performe on some columns without loosing other ones ?
>
> thanks
>