Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to count number of columns in dataframe python

import pandas as pd
df = pd.DataFrame({"pear": [1,2,3], "apple": [2,3,4], "orange": [3,4,5]})

len(df.columns)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #number #columns #dataframe #python
ADD COMMENT
Topic
Name
2+4 =