Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

set index values pandas

# Create a Pandas dataframe
df = pd.DataFrame({'A':[1, 2, 3, 4],
				   'B':[5, 6, 7, 8]})

# Rename index values for each row
df.set_axis(['Row_1', 'Row_2', 'Row_3', 'Row_4'], axis = 'index', inplace = True)
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #set #index #values #pandas
ADD COMMENT
Topic
Name
6+2 =