Advertisements
Advertisements
प्रश्न
Can you write a program to count the number of rows and columns in a DataFram?
कोड लेखन
Advertisements
उत्तर
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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
