Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print column name and index python

import pandas as pd

# Dataframe example
df = pd.DataFrame({'col_A':[1,5,7,8],'col_B':[9,7,4,3], 'col_C':[5,1,4,9]})

# Showing all column names and indexes for df
print(* (f"{i}: {col}" for i,col in enumerate(df.columns)), sep='
')
Comment

PREVIOUS NEXT
Code Example
Python :: Show all column names and indexes dataframe python 
Python :: Sys Gets os name ,which u using 
Python :: spread in python 
Python :: range(n,n) python 
Python :: what is an indefinite loop 
Python :: recall calculate confusion matrix .ravel() 
Python :: web3.py failing not installing 
Python :: isenable selenium python 
Python :: python append many items to a list 
Python :: icloud api python 
Python :: expected a list of items but got type int . django 
Python :: python string: string concatenation 
Python :: python function pointer with multiple args 
Python :: python - notification messages 
Python :: select columns rsnge dataframe 
Python :: python specify multiple possible types 
Python :: flask base __init__.py file 
Python :: python quickly goto line in file 
Python :: flask example 
Python :: remove color from shapefile python 
Python :: py3-env.bat 
Python :: limit entries in dataframe column 
Python :: rtdpy ncstr 
Python :: np random choice given distribution 
Python :: django drf endpoint without model 
Python :: python return true for list comprehension 
Python :: spark write progress bar jupyter 
Python :: how to close turle loop 
Python :: linear algebra ipython notebook 
Python :: import all models 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =