일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- matplotlib
- dataframe
- google apps script
- array
- numpy
- 파이썬
- c#
- GIT
- math
- list
- Kotlin
- Apache
- Java
- PostgreSQL
- PySpark
- gas
- Tkinter
- Github
- string
- Redshift
- hive
- Google Spreadsheet
- SQL
- PANDAS
- django
- Google Excel
- Python
- Mac
- Excel
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
특정 위치를 기준으로 셀을 삽입하고, 행 또는 열을 삽입하는 방법을 알아봅시다. 일단 셀 삽입, 행/열 삽입 기능을 사용하기 위해선 insertCells method를 이용해야 합니다. Syntax CellObject.insertCells(dimension) insertCells method는 특정 셀의 위치를 기준으로 셀을 입하는 기능이기 때문에 Cell object에서 사용할 수 있습니다. 주로 sheet.getRange('B3') 이렇게 getRange method를 써서 특정 위치의 cell 객체에 insertCells를 사용합니다. - dimension parameter로는 dimension 하나를 받습니다. 행 방향으로 삽입을 할건지 열 방향으로 삽입을 할건지를 나타내는 인자라고 보면 됩니다...
dictionary를 JSON data로 바꾸고 .json 파일을 생성해봅시다. - 참고 = dictionary json 변환 https://cosmosproject.tistory.com/758 import json dict_data = { "category": "fruits", "product_cnt": 2, "product": { "Apple": { "price": 20000, "weight": 3 }, "Watermelon": { "price": 18000, "screen_size": 2 }, } } json_data = json.dumps(dict_data) print(json_data) print(type(json_data)) with open('json_data.json', 'w') as f:..
JSON (JavaScript Object Notation) 데이터는 프로그래밍에서 자주 쓰이는 형태의 데이터입니다. 다양한 정보를 보고 다루기 쉽게 저장할 수 있죠. 기본적으로 JSON data는 Python의 dictionary type과 매우 유사합니다. Python의 dictionary를 JSON 형태의 string으로 변환하기 위해서는 json library의 dumps method를 사용하면 됩니다. Syntax json.dumps(dictionary, indent=n) - dictionary JSON 형태의 string으로 변환할 dictionary 입니다. - indent = n optional한 parameter입니다. 명시하지 않아도 되며 명시할 경우 출력할 때 더 보기 쉽게 n개 만큼..
requests library와 API를 이용하다보면 csv format의 데이터를 얻어올 때가 있습니다. 그 결과값은 API를 어떻게 만드냐에 따라 달라질 수 있지만 주로 보이는 형태는 아래와 같습니다. import requests api_endpoint = 'https://test_api/get_data' response = requests.get(api_endpoint) print(response.status_code) print(response.content) print(type(response.content)) -- Result 200 b'modelno,name,price,weight\r\nAGH1341,Laptop,1300000,1200\r\nSOE1029,Desktop,1800000,3500..