मराठी

Can you write a program to count the number of rows and columns in a DataFram?

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 2: Data Handling using Pandas - I - Intext Questions [पृष्ठ ४६]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 12
पाठ 2 Data Handling using Pandas - I
Intext Questions | Q 10 | पृष्ठ ४६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×