강의

멘토링

로드맵

Inflearn Community Q&A

leedabin20021463's profile image
leedabin20021463

asked

Data-driven stock quant investment with Python Part 1

3.4 Sorting

4.정렬 강의 중 문의드립니다.

Resolved

Written on

·

316

0

마지막에 sort 부분에서

df.sort_values(

    ['순이익률(%)', 'EPS(원)'],

    ascending=[True, False]

).head()

에서 의미가 없다고 하신 이유가

예를들어 

df.sort_values(

    ['sector', 'EPS(원)'],

    ascending=[True, False]

).head()

라고 한다면 

sector 가 중복되는 부분이 있고

그 중복되는 부분에서만 다시 'EPS(원)' 으로 재정렬이 된다는

의미인가요?

sector  EPS

가       3.5

가       2.1

가       1.6

나       4.0

다       10.1

다       5.5

다       2.8

라       4.2

이렇게 있을때 첫번째 sector 로 중복되어 있는 부분이 있을때

이 중복되는 것들끼리해서 다시 EPS로 내림차순으로 재정렬을

시켜준다고 이해하면 될까요?

투자pandas퀀트

Answer 2

1

DeepingSauce님의 프로필 이미지
DeepingSauce
Instructor

정확하게 이해하셨습니다 :) 

0

leedabin2002님의 프로필 이미지
leedabin2002
Questioner

오!! 답변 주셔서 감사합니다^^~

leedabin20021463's profile image
leedabin20021463

asked

Ask a question