Casting a PySpark DataFrame column to a specific datatype

import pyspark.sql.functions as F
from pyspark.sql.types import IntegerType
# Cast the count column to an integer
dataframe.withColumn("count", F.col("count").cast(IntegerType()))