python 5

[프로그래머스] 직사각형 좌표 구하기, 나머지 한 점(cpp/python)

https://programmers.co.kr/learn/courses/18/lessons/1878?language=cpp 알고리즘 문제 해설 - 나머지 한 점 프로그래머스의 모의테스트는 프로그래머스의 시스템에 익숙해지기 위한 테스트이며, 문제 자체는 2018 1ST KAKAO BLIND RECRUITMENT와 전혀 관계없습니다. 다만 모의테스트의 풀이에 대한 요청이 있어 programmers.co.kr 문제 3점이 주어지면 직사각형을 만들 수 있는 한 점을 구하는 문제다 풀이 x좌표, y좌표 각각 한 번씩만 나온 점을 가져와주면 된다. 나왔는지 안나왔는지를 반복문과 조건문을 써서 찾아도 되지만 XOR을 이용하면 더 간단하게 풀 수 있다. XOR는 보통 같은 값이면 0, 다르면 1이라고 하는데 1이 홀수..

Python IP주소로 위도, 경도 위치 찾기 (latitude, longitude)

- IP주소 검색해보기 aws cloudfront를 사용하는데 어떤 주소는 aws 본사 위치가 나오고 어떤 건 aws edge server 위치를 알려주고,, 이거 뭐,, https://www.whtop.com/tools.ip IPv4 & IPv6 location: find Country, Region, City, ISP & more Free IPv6 and IPv4 location & address locator. Find Country, Region & City based on IP, Zip Code, ISP (name/url), Latitude & Longitude. Updated Dec 2020 www.whtop.com ip주소 검색 해보는 건 그래서 여기서 검색하는 걸로 바꿨다 - Python ..

Programming/Python 2020.12.04

Python plotly 그라데이션 색 점 찍기

www.w3schools.com/colors/colors_hsl.asp Colors HSL Colors HSL HSL Colors HSL color values are supported in IE9+, Firefox, Chrome, Safari, and in Opera 10+. HSL stands for hue, saturation, and lightness. HSL color values are specified with: hsl(hue, saturation, lightness). Hue Hue is a degree on the color w www.w3schools.com 이 사이트에서 채도랑 명도를 체크해서 어느 정도로 할 건지 미리 보고 결정을 한다 color = ['hsl(' + str(h) +..

Programming/Python 2020.10.10

Python plotly scatter, scattergeo, layout geo, 화면 분할

- 창 분할하기 def draw_graph(): # 그래프 그릴 때 필요한 정보값들 미리 준비해놓기 # x축의 값을 맡아줄 변수 셋팅 x = [i for i in range(TEST_VIDEO_MAX)] # 위아래 분할로 만들기 fig = make_subplots( rows=2, cols=1, # 분할의 타입을 먼저 설정해줘야함 specs=[[{"type": "xy"}], [{"type": "scattergeo"}]], ) - 반복문 돌면서 값 여러 개 넣기 # list or dict 안에 있는 클래스의 리스트의 값을 넣고 싶을 때.. for i, log in enumerate(log_dict.values()): #scatter 형태로 fig.add_trace(go.Scatter( #아까 만든 x축 해줄..

Programming/Python 2020.07.23

Python Plotly 하다가 레퍼런스 잘 안나와서 모아놓는 document들

# 사용한 버전 pip install plotly==4.9.0 #dragmode: 드래그 모드 어떤 걸로 할지 설정하는거 #['orbit', 'turntable', 'zoom', 'pan', False] - '어떻게 만들어야할지 모르겠다 or 이렇게 어떻게 함'일 때 찾아보는 다른 사람들의 그래프 chart-studio.plotly.com/ Plotly | Make charts and dashboards online chart-studio.plotly.com 여기에 하고 싶은 거 검색한 다음에 editor로 들어가서 이것저것 눌러서 바까도 보고 내 코드에 적용하고 싶으면 JSON에서 attribute값 보고 그대로 적용하면 됨 - scattergeo 지도 종류 보기 (그림) plotly.com/pytho..

Programming/Python 2020.07.23