Re: how to change data type for columns of dataframe

2022-04-02 Thread Bjørn Jørgensen
https://sparkbyexamples.com/pyspark/pyspark-cast-column-type/


lør. 2. apr. 2022 kl. 04:10 skrev ayan guha :

> Please use cast. Also I would strongly recommend to go through spark doco,
> its pretty good.
>
> On Sat, 2 Apr 2022 at 12:43 pm,  wrote:
>
>> Hi
>>
>> I got a dataframe object from other application, it means this obj is
>> not generated by me.
>> How can I change the data types for some columns in this dataframe?
>>
>> For example, change the column type from Int to Float.
>>
>> Thanks.
>>
>> -
>> To unsubscribe e-mail: user-unsubscr...@spark.apache.org
>>
>> --
> Best Regards,
> Ayan Guha
>


-- 
Bjørn Jørgensen
Vestre Aspehaug 4, 6010 Ålesund
Norge

+47 480 94 297


Re: how to change data type for columns of dataframe

2022-04-01 Thread ayan guha
Please use cast. Also I would strongly recommend to go through spark doco,
its pretty good.

On Sat, 2 Apr 2022 at 12:43 pm,  wrote:

> Hi
>
> I got a dataframe object from other application, it means this obj is
> not generated by me.
> How can I change the data types for some columns in this dataframe?
>
> For example, change the column type from Int to Float.
>
> Thanks.
>
> -
> To unsubscribe e-mail: user-unsubscr...@spark.apache.org
>
> --
Best Regards,
Ayan Guha


how to change data type for columns of dataframe

2022-04-01 Thread capitnfrakass

Hi

I got a dataframe object from other application, it means this obj is 
not generated by me.

How can I change the data types for some columns in this dataframe?

For example, change the column type from Int to Float.

Thanks.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org