Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print column name and index dataframe

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 :: pandas set index 
Python :: get number of row dataframe pandas 
Python :: object has no attribute python 
Python :: python enum 
Python :: indefinite loops python 
Python :: python randint with leading zero 
Python :: for loop practice problems python 
Python :: string contains element of list python 
Python :: asyncioevents.py", line 504, in add_reader raise NotImplementedError 
Python :: Python OPERATORS, Data Types: LIST, SET, TUPLE, DICTIONARY 
Python :: convert from R to python 
Python :: keras.utils.plot_model keeps telling me to install pydot and graphviz 
Python :: Python - Comment vérifier une corde est vide 
Python :: python - dashboard 
Python :: kill os system by pid python script 
Python :: airflow find trigger type 
Python :: python you bad 
Python :: comment on inclut date et heure en python svp 
Python :: extract parameter of voice using python 
Python :: how to select specific column with Dimensionality Reduction pyspark 
Python :: What is StringIndexer , VectorIndexer, and how to use them? 
Python :: pyglet template 
Python :: pandas dtodays date csv 
Python :: horney 
Python :: python geopandas read layer from gdb 
Python :: python project pick text color according to background 
Python :: python cgi get raw post data 
Python :: arma-garch python 
Python :: train chatterbot using yml 
Python :: what does eval function do in python stack overflow 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =