일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- pandas 행 제거
- 선형함수 딥러닝
- sktime 예제
- pytorch dataset split
- layer 일부 freeze
- 비선형함수
- 비선형함수 딥러닝
- pandas row 제거
- sktime 튜토리얼
- 모델 freeze
- EDA 추천 파이썬
- Prompt Tuning for Graph Neural Networks
- Graph Theory
- 경우의 수 파이썬
- pretraining
- 시계열 라이브러리
- sktime
- EDA in python
- pytorch 데이터셋 나누기
- 일부 레이어 고정
- Skip connection
- pandas
- pandas 조건
- molecular representation
- weight 일부 고정
- pandas 특정 조건 열 제거
- sktime tutorial
- Does GNN Pretraining Help Molecular Representation?
- 판다스 조건
- python 경우의 수
- Today
- Total
목록Study/Python (7)
MoonNote
torch.sum 에는 차원을 정해주는 argument가 있다. dim=0 column 별로 더한 값이고 dim=1 은 row별로 더한 값을 출력한다. import torch a = torch.randn(2, 3) >>>print(a) >>>print(torch.sum(a, dim=0)) >>>print(torch.sum(a, dim=1)) tensor([[-0.2771, 0.4708, 0.7797], [ 2.8122, -1.0677, 1.7852]]) tensor([ 2.5351, -0.5969, 2.5649]) tensor([0.9734, 3.5298])
https://drive.google.com/drive/folders/1laPfUDVMu2MOzNVsuO9CTDsme2WruiIF?usp=sharing LG실습 - Google Drive 이 폴더에 파일이 없습니다.이 폴더에 파일을 추가하려면 로그인하세요. drive.google.com

Installation pip install pandas-profiling 사용법 - 데이터의 크기가 크다면 다음과 같은 방법으로 파일을 저장하는 것을 추천한다. from pandas_profiling import ProfileReport profile = ProfileReport(df, minimal=True) # output.html 파일 생성 profile.to_file("output.html") - output 파일이 생성된 것을 확인할 수 있다. 열어보면, 다음과 같이 데이터를 편리하게 확인할 수 있다.
ANC라는 column의 값이 4352인 row를 제거하고 싶을 때 df = df.drop(df[df['ANC']==4352].index) 또는 df = df.drop(df[df['ANC']==4352].index, inplace=True) 1번째 row를 제거하고 싶을 때 df = df.drop(df.index[1])
1. and 조건의 경우에는 &을 사용한다. df1 = df[(df.a != -1) & (df.b != -1)] 2. or 조건의 경우에는 |을 사용한다. df2 = df[(df.a != -1) | (df.b != -1)]
from itertools import combinations features = ['GzmB1', 'age', 'Mean_pack_years', 'ANC', 'ALC', 'NLR', 'CRP', 'CEA', 'sex', 'smoking'] features_combination = [] # feature의 모든 조합을 구하기(1~10개) for i in range(1, len(features) +1 ): features_combination += list(combinations(features, i)) print(features_combination)

연속형 변수일 때 # Multiple box plots on one Axes fig, ax = plt.subplots(figsize=(12,10)) data = [df_0['age'], df_1['age']] labels = ['normal', 'cancer'] bp = ax.boxplot(data, vert=True, patch_artist=True) #fill with colors colors = ['lightblue', 'pink'] for patch, color in zip(bp['boxes'], colors): patch.set_facecolor(color) #adding horizontal grid lines ax.yaxis.grid(True) plt.title('Age', fontsize= ..