number of rows in dataframe pyspark

print((df.count(), len(df.columns)))

Here is what the above code is Doing:
1. We’re using the read_csv() function from pandas to read the CSV file into a DataFrame.
2. We’re using the count() function to count the number of rows in the DataFrame.
3. We’re using the len() function to count the number of columns in the DataFrame.