Advertisements
Advertisements
Question
Can you write a program to count the number of rows and columns in a DataFram?
Code Writing
Advertisements
Solution
import pandas as pd
df = pd.DataFrame()
rows, columns = df.shape
print("Number of rows:", rows)
print("Number of columns:", columns)
Explanation:
shape returns the number of rows and columns in a DataFrame.
shaalaa.com
Is there an error in this question or solution?
