so, basically I already have the database loaded in pyspark. When I tried to use the below query it gave an error:
df.apply(lambda x: x.count(), axis=1)