일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- hive
- Apache
- Redshift
- 파이썬
- Google Excel
- django
- Github
- Google Spreadsheet
- Java
- GIT
- Kotlin
- Excel
- Python
- numpy
- PANDAS
- Tkinter
- string
- PySpark
- matplotlib
- array
- gas
- SQL
- math
- PostgreSQL
- Mac
- c#
- dataframe
- google apps script
- list
- Today
- Total
목록Python (384)
달나라 노트
openpyxl의 cell 객체를 이용하면 특정 cell의 다양한 정보를 가져올 수 있습니다. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['a', 'b', 'c', 'd', 'e'], 'col3': [1234, 0.27383720, 39372, None, 102947291.293472], 'col4': [0.9, 0.5238, 0.13, 0.0028, 1024.29278], } df_test = pd.DataFrame(dict_test) xlsx_writer = pd.ExcelWriter('test.xlsx', engine='openpyxl') df_test.to_excel(xlsx_writer, sheet_name='test..

worksheet 객체의 column_dimensions, row_dimensions를 이용하면 column width, row height을 조절할 수 있습니다. import pandas as pd dict_test = { 'col1': [1, 2, 3], 'col2': ['a', 'b', 'c'], 'col3': [1234, 2817, 209183], } df_test = pd.DataFrame(dict_test) xlsx_writer = pd.ExcelWriter('test.xlsx', engine='openpyxl') df_test.to_excel(xlsx_writer, sheet_name='test1', index=False) worksheet = xlsx_writer.sheets['test1'..

pandas의 to_excel에서 startcol, startrow 옵션을 이용하면 어느 위치에 DataFrame을 위치시킬지 결정할 수 있습니다. import pandas as pd dict_test = { 'col1': [1, 2, 3], 'col2': ['a', 'b', 'c'], 'col3': [1234, 2817, 209183], } df_test = pd.DataFrame(dict_test) xlsx_writer = pd.ExcelWriter('test.xlsx', engine='openpyxl') df_test.to_excel(xlsx_writer, sheet_name='test1', startcol=2, startrow=3) xlsx_writer.close() 위 코드의 결과는 다음과 같습..

데이터 분석을 하다보면 시각화는 꽤 중요한 부분 중 하나입니다. 근데 간혹 x축 값과 y축 값이 너무 커지게 되면 값들을 좌표평면 상에 나타낸다고 해도 그 경향성을 시각화하기가 어려울 수 있습니다. 예를들어 y = 1500 / x 라는 함수를 만족하는 값들을 가지고 있고, 이 값들을 그래프로 나타내본다고 해봅시다. import matplotlib.pyplot as plt import numpy as np list_x = np.linspace(0, 2000, 10000) list_y = [] for x in list_x: val_result = 1500 / x list_y.append(val_result) plt.plot(list_x, list_y, color='gray') plt.show() matplo..