I'm having a hard time understanding what pandas.DataFrame.loc does in this line of code

Viewed 31

I'm tracing a basic machine learning python code to learn the basics and i stumbled upon these two lines of code:

data.loc[:,'symboling'] = data['symboling'].astype('object')
data.rename(columns={'symboling':'riskScore'},inplace=True)

first of all "data" is the csv file after being read with panda.read_csv and "symboling" is one of the column labels (the first one).

I understood the second line from the Pandas docs but I dont get what the first line does at all.

1 Answers
Related