일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- dataframe
- list
- PANDAS
- Excel
- Kotlin
- math
- PostgreSQL
- hive
- Google Excel
- c#
- PySpark
- google apps script
- numpy
- Apache
- matplotlib
- Java
- Redshift
- Python
- Mac
- array
- Google Spreadsheet
- Tkinter
- django
- gas
- SQL
- string
- Github
- GIT
- 파이썬
- Today
- Total
목록분류 전체보기 (847)
달나라 노트
from pyhive import hive def query_execute_hive(query, result_cols): hive_connection = hive.Connection( host='host_name_url', port=10000 # port_number, username='hive_user_id', password='hive_user_password', database='default', auth='LDAP' ) cursor = hive_connection.cursor() raw_query_list = query.split(';\n') raw_query_list = [str(x).strip() for x in raw_query_list] raw_query_list = list(filter(..
import psycopg2 import pandas as pd def query_runner(query): dbname = 'sandbox' host = 'test_host' port = 1111 # port_number user_id = 'redshift_user_id' password = 'redshift_user_name' connection_info = "dbname='{}' host='{}' port={} user='{}' password='{}'".format(dbname, host, port, user_id, password) connection = psycopg2.connect(connection_info) cursor = connection.cursor() cursor.execute(q..
webbrowser library makes it possible for us to open url on your browser. import webbrowser url = 'https://www.google.com' webbrowser.open(url, new=1) The above code will open google in your base web browser. new = 0 -> open url in the same browser window. new = 1 -> open url in a new browser window. new = 2 -> open url in a new browser tab.
Python에선 googletrans라는 번역 기능을 가진 library를 제공합니다. googletrans 설치 pip install googletrans==4.0.0-rc1 일반적인 설치법으로 pip install googletrans를 하게되면 가끔 AttributeError: 'NoneType' object has no attribute 'group' 위와 같은 에러가 지속적으로 뜨는 경우가 있습니다. 이럴 경우에는 위 커맨드로 해당 버전을 설치해줍시다. (참고 : github.com/ssut/py-googletrans/issues/234) from googletrans import Translator translator = Translator() translated_obj = translator..