Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] 데이터 분석 인터페이스 구현 #20

Merged
merged 12 commits into from
Nov 19, 2024
Merged

Conversation

eyeol
Copy link
Contributor

@eyeol eyeol commented Nov 18, 2024

📝 Summary

Streamlit으로 구현된 데이터 분석 인터페이스입니다.

스크린샷 2024-11-18 오후 3 20 45

현재 구현된 기능

  • 데이터셋 정보 요약 및 헤드 출력
  • 전체 데이터셋 확인
  • 인덱스, Column 통한 데이터 접근
  • 개별 데이터를 수능 문제 형식으로 출력

✅ Checklist

  • 관련 이슈가 명시되어 있습니다.
  • 테스트가 완료되었습니다.
  • 문서 업데이트가 포함되었습니다.
  • 코드 리뷰를 위한 사전 검토를 완료했습니다.

📄 Description

데이터 개요 탭

스크린샷 2024-11-18 오후 3 23 42

df.info()와 df.head()의 출력값을 확인할 수 있습니다.

데이터 탐색 탭

스크린샷 2024-11-18 오후 3 25 51

전체 데이터셋을 확인할 수 있는 화면이 있습니다.
화면 안에서 ctrl + F로 키워드 검색이 가능합니다.

오른쪽 위에 있는 버튼으로 csv 파일을 다운로드할 수 있습니다.



스크린샷 2024-11-18 오후 3 31 14

인덱스를 통한 데이터 접근, Column에 포함된 값을 통한 데이터 필터링 기능을 제공합니다.

  • Index: 인덱스를 통해 단일 데이터를 불러옵니다
  • Column: 필터링의 기준이 될 Column을 선택하고, 키워드를 입력해서 해당되는 데이터들을 모두 불러옵니다.

스크린샷의 경우, paragraph법조계라는 단어가 포함된 데이터들을 불러왔습니다.



스크린샷 2024-11-18 오후 3 37 53

인덱스를 입력하면, 해당 인덱스의 데이터를 수능 형식으로 출력하는 기능을 제공합니다.

데이터 분포 탭

아직 기능 미구현 상태입니다.
추후에 추가될 예정입니다.

💡 Notice (Optional)

  1. requirements.txtstreamlitstreamlit-option-menu가 추가되었습니다.

  2. 노션에 대략적인 코드 해설을 올려놓았습니다.
    필요하신 분들은 참고하시면 될 것 같습니다.

🔗 Related Issue(s)

close #13

@eyeol eyeol added Priority: Medium 적절한 시기에 처리해야 할 작업 Type: Enhancement 기능 개선 작업 labels Nov 18, 2024
@eyeol eyeol self-assigned this Nov 18, 2024
@eyeol eyeol linked an issue Nov 18, 2024 that may be closed by this pull request
6 tasks
Copy link
Contributor

@gsgh3016 gsgh3016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으셨습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기능 별로 차근차근 구현하려고 노력한게 보여 좋습니다!

st.write(f"Row at index {int(index_input)}:")
st.write(row_data)
else:
st.error("Invalid index. Please try again.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

소소한 팁인데 다음과 같이 코드를 바꾸면 어떨까요?

if not st.button("Retrieve by Index") or not (0 <= index_input < len(df)):
    st.error("Invalid index. Please try again.")
...

혹은 index_input 선언 이후 바로 검사를 진행해도 좋을 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린샷 2024-11-19 오전 11 09 33

해당 방식으로 테스트했을 때, 데이터를 불러오는 과정은 문제없이 작동했으나 사소한 문제점이 있었습니다.

스크린샷에 나온 - + 버튼으로 인덱스를 바꿀 때마다 <Retrieve by Index 버튼이 눌리지 않은 상황>으로 인식하여
불필요한 에러 메세지를 출력하게 되었습니다.

기존 방식은 Retrieve by Index 버튼이 눌린 후에 입력된 인덱스 값의 범위에 따라
에러 메세지 출력 여부를 결정하는 방식이라 이러한 문제가 발생하지 않는 것 같습니다.

이에 기존 방식을 고수하기로 했습니다. 꼼꼼하게 리뷰해주셔서 감사합니다 👍

@@ -98,8 +134,7 @@ def filter_data_by_column(df: pd.DataFrame):
elif access_method == "Filter by Column":
filter_data_by_column(df)

# TODO: 수능 문제 형태로 출력
pass
display_question_format(df)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중간 중간 모듈화 좋습니다!! 추후에 streamlit 기능 관련 모듈 구조 어떻게 잡을지 논의해도 좋을 듯 싶어요.

analysis_dashboard.py Outdated Show resolved Hide resolved
test.csv에 answer 행이 없어서 KeyError가 발생하는 문제가 있었습니다.
문제가 되는 부분을 조건문 처리하여 수정했습니다.

나중에 로직을 개선할 여지가 있다고 생각됩니다.
@eyeol eyeol merged commit dc4efe3 into main Nov 19, 2024
3 checks passed
@eyeol eyeol deleted the feature/13-streamlit branch November 19, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium 적절한 시기에 처리해야 할 작업 Type: Enhancement 기능 개선 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Streamlit을 통한 데이터 분석 인터페이스 구현
3 participants