일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- PostgreSQL
- Excel
- Github
- google apps script
- Redshift
- c#
- array
- SQL
- GIT
- Kotlin
- numpy
- Google Excel
- string
- hive
- Apache
- gas
- Google Spreadsheet
- Tkinter
- Java
- 파이썬
- matplotlib
- django
- PANDAS
- PySpark
- Mac
- dataframe
- Python
- list
- math
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
Python의 빌트인 함수인 any, all method를 알아봅시다. any, all method를 간략하게 정리해보면 아래와 같습니다. any : 전달받은 요소 중 하나 이상이 True일 경우 True return. (모든 요소가 False인 경우 False return) all : 전달받은 요소 전부가 True일 경우 True return. (하나라도 False가 있을 경우 False return) 또한 any, all method의 주의점은 list나 tuple같은 반복 가능한(iterable) 데이터를 parameter로서 받는다는 것입니다. 다음 예시를 보시죠. print(any([True, True])) # Result --> True print(any([True, False])) # Res..
pyhive 라이브러리는 python에서 서버에 접근하여 Hive SQL query를 실행할 수 있도록 해줍니다. 이번에는 pyhive 라이브러리를 이용해서 Hive query를 돌리는 예시를 봐봅시다. 아래 코드가 가장 기본적인 pyhive 사용 예시입니다. from pyhive import hive import pandas as pd hive_con = hive.Connection( host='test_host', port=10000, username='test_user_id', password='test_user_password', database='default', auth='LDAP' ) cursor = hive_con.cursor() test_query = ''' select tt.id, tt..

matplotlib에서는 clf, cla라는 method가 있습니다. clf method는 clf method가 적용된 그래프의 figure를 지웁니다. figure를 지운다고 하니까 좀 의미가 와닿지 않는데, 좀 더 간단하게 말하면 그래프 / 좌표평면 / title / x label / y label / xlim / ylim 등 모든걸 지운다고 보시면 됩니다. cla method는 좌표평면을 제외한 내용을 지워줍니다. 따라서 cla method를 적용한 그래프에는 좌표평면만 남고 좌표평면 자체를 제외한 모든 것(그래프 / title / x label / y label / xlim / ylim 등)이 지워집니다. import matplotlib.pyplot as plt list_x = [0, 1, 2, ..

matplotlib의 subplots는 여러 개의 그래프를 바둑판식으로 배열하여 나타내줍니다. 무슨 소리인지 하나씩 알아가봅시다. import matplotlib.pyplot as plt sub_plots = plt.subplots(nrows=3, ncols=2) fig = sub_plots[0] graph = sub_plots[1] fig.suptitle('Multiple plots') fig.tight_layout(pad=2) plt.show() 위 코드를 실행한 결과를 봅시다. 그래프가 총 6개가 생겼고 이것이 3행 2열의 형태로 배치되어있습니다. 이런식으로 subplots는 한번에 여러 개의 그래프를 동시에 그려줍니다. 그래프를 동시에 그린다는 의미가 xlim, ylim method를 사용할 때와..