일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Python
- mariadb
- GT-S80
- Lotto
- SPL
- keras
- E-P1
- SciPy
- Numpy
- DFS
- Button
- Series
- mean
- synology
- javascript
- Splunk
- RNN
- ipad
- dataframe
- pip
- pandas
- CNN
- imread
- install
- 삼성소프트웨어멤버십
- LSTM
- index
- pycharm
- GitHub
- 알고리즘
Archives
- Today
- Total
잠토의 잠망경
[pandas] groupby 본문
groupby하기 위해서 dataframe이 사용된다.
autoindicate를 위하여 DataFrameGroupBy를 추가하면 mean, std 같은 이미 정의된 class member를 사용할 수 있다.
from pandas.core.groupby.groupby import DataFrameGroupBy
def makeGroup(df:DataFrame)->None:
print(df.info())
grouped:DataFrameGroupBy = df.groupby(['file_name'])
for key, item in grouped:
print(key)
print(item)
grouped:DataFrameGroupBy = df.groupby(['order'])
for key, item in grouped:
print(key)
print(item)
../datas\sincontan1.txt
order ... file_name
0 0 ... ../datas\sincontan1.txt
1 1 ... ../datas\sincontan1.txt
2 2 ... ../datas\sincontan1.txt
3 3 ... ../datas\sincontan1.txt
4 4 ... ../datas\sincontan1.txt
5 5 ... ../datas\sincontan1.txt
6 6 ... ../datas\sincontan1.txt
7 7 ... ../datas\sincontan1.txt
8 8 ... ../datas\sincontan1.txt
9 9 ... ../datas\sincontan1.txt
10 10 ... ../datas\sincontan1.txt
11 11 ... ../datas\sincontan1.txt
12 12 ... ../datas\sincontan1.txt
13 13 ... ../datas\sincontan1.txt
14 14 ... ../datas\sincontan1.txt
15 15 ... ../datas\sincontan1.txt
16 16 ... ../datas\sincontan1.txt
17 17 ... ../datas\sincontan1.txt
18 18 ... ../datas\sincontan1.txt
19 19 ... ../datas\sincontan1.txt
20 20 ... ../datas\sincontan1.txt
21 21 ... ../datas\sincontan1.txt
22 22 ... ../datas\sincontan1.txt
[5 rows x 5 columns]
555
order sin ... tan file_name
555 555 -0.258819 ... 0.267949 ../datas\sincontan1.txt
555 555 -0.258819 ... 0.267949 ../datas\sincontan2.txt
555 555 -0.258819 ... 0.267949 ../datas\sincontan3.txt
555 555 -0.258819 ... 0.267949 ../datas\sincontan4.txt
555 555 -0.258819 ... 0.267949 ../datas\sincontan5.txt
Comments