0

What is the difference between the following approaches to get the rows from a column of df, a pandas DataFrame :

df['col_name'][x:y]

vs.

df.loc[x:y,'col_name']

Laurent
  • 12,287
  • 7
  • 21
  • 37
variable
  • 8,262
  • 9
  • 95
  • 215
  • Does this answer your question? [What is the difference between using loc and using just square brackets to filter for columns in Pandas/Python?](https://stackoverflow.com/questions/48409128/what-is-the-difference-between-using-loc-and-using-just-square-brackets-to-filte) – Laurent Dec 25 '22 at 18:18

0 Answers0