일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- PostgreSQL
- Google Excel
- Github
- Redshift
- Google Spreadsheet
- string
- gas
- c#
- dataframe
- hive
- Python
- PANDAS
- Excel
- array
- Java
- Tkinter
- SQL
- Apache
- math
- numpy
- PySpark
- 파이썬
- matplotlib
- google apps script
- Mac
- list
- GIT
- Kotlin
- django
- Today
- Total
목록Python (384)
달나라 노트
cumsum은 누적합을 구하며cumprod는 누적곱을 구합니다. cumsum부터 알아봅시다. Syntaxcumsum(skipna=True/False, axis=0/1)cumprod(skipna=True/False, axis=0/1) - skipnaTrue일 경우 NaN값을 무시하고 계산합니다.False일 경우 NaN값을 고려하고 계산합니다. - axis누적합을 구할 축을 지정합니다.기본값은 0이며 0으로 지정해야 컬럼 기준 누적합이 됩니다. import pandas as pddict_test = { 'seq': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'id': [1, 1, 1, 1, 1, 2, 2, 2, 2, 2], 'qty': [200, 80, 150, 50, 1..
DataFrame에 있는 특징 한 가지를 알아보겠습니다. import pandas as pddict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': [2, 3, 4, 5, 6],}df_test = pd.DataFrame(dict_test)df_test_1 = df_testdf_test_1.loc[:, 'col3'] = 3 df_test를 생성하고 df_test_1 = df_test 처럼 df_test_1에 df_test를 할당하였습니다. - df_test_1.loc[:, 'col3'] = 3그리고 df_test_1에 col3를 추가하였습니다. 그러면 df_test_1에만 col3가 생길까요?아니면 df_test에도 col3가 생길까요? 정답은 df_test에도 col..
Pandas의 columns는 DataFrame에 존재하는 Column의 정보를 출력해줍니다. import pandas as pddict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': [2, 3, 4, 5, 6],}df_test = pd.DataFrame(dict_test)print(df_test)print(df_test.columns)-- Result col1 col20 1 21 2 32 3 43 4 54 5 6Index(['col1', 'col2'], dtype='object') list() method를 이용해서 column을 list의 형태로 만들 수도 있습니다. import ..
WEB을 다루다 보면 API를 호출해서 데이터를 불러올 때가 있는데 이때 아래처럼 내가 받은 데이터가 깨져 보일 때가 있습니다. 이를 해결할 수 있는 두 가지 방법을 봐보겠습니다. 첫 번째 방법입니다. b'\xc2\xd4\xb5\xa0/\xc6\xdf\xb2\xe2\xb0\xb6\xba\xb5' 맨 앞에 b가 붙었다는 것은 바이트(byte) type의 데이터라는 의미입니다. Encoding을 바꿔주면 해결할 수 있습니다. import requestsurl = 'https://apihub.kma.go.kr/api/typ01/url/fct_afs_wl.php'params = { 'tmfc1': '2024042200', 'tmfc2': '2024042223', 'mode': '0', ..