Programming Language

Programming Language/Python

[Python] read_csv의 parse_dates 옵션 사용해보기

기본형 df = pd.read_csv('/kaggle/input/london-bike-sharing-dataset/london_merged.csv') df.head() 데이터의 구조, 타입, 컬럼 확인하기 print('\n', df.shape) print('\n', df.dtypes) print('\n', df.columns) timestamp가 object 형인 것을 확인할 수 있다. 다음은 parse_dates 를 사용해보자. df = pd.read_csv('/kaggle/input/london-bike-sharing-dataset/london_merged.csv', parse_dates = ['timestamp']) # df = pd.read_c..

Programming Language/Python

[Kaggle] London bike sharing dataset 그래프 그려보기

https://www.kaggle.com/datasets/hmavrodiev/london-bike-sharing-dataset London bike sharing dataset Historical data for bike sharing in London 'Powered by TfL Open Data' www.kaggle.com import numpy as np import pandas as pd import os for dirname, _, filenames in os.walk('/kaggle/input'): for filename in filenames: print(os.path.join(dirname, filename)) import matplotlib.pyplot as plt import seabo..

Programming Language/Python

[Kaggle] London bike sharing dataset 데이터 살펴보기

https://www.kaggle.com/datasets/hmavrodiev/london-bike-sharing-dataset London bike sharing dataset Historical data for bike sharing in London 'Powered by TfL Open Data' www.kaggle.com import numpy as np import pandas as pd import os for dirname, _, filenames in os.walk('/kaggle/input'): for filename in filenames: print(os.path.join(dirname, filename)) import matplotlib.pyplot as plt import seabo..

Programming Language/Python

[Python] RL, 강화학습 Frozen-Lake Dummy Q-Learning 실행하는 방법

https://github.com/ParkGyeongTae/dqn-atari-breakout/tree/main/3_frozenlake_v0 GitHub - ParkGyeongTae/dqn-atari-breakout Contribute to ParkGyeongTae/dqn-atari-breakout development by creating an account on GitHub. github.com ### Step 1) 아나콘다 가상환경 만들기 conda create -n py37 python=3.7 ### Step 2) 가상환경 접속 conda activate py37 ### Step 3) 라이브러리 설치 pip install gym==0.23.1 pip install pygame==2.1.2 pip i..

Programming Language/Python

[Python] RL, 강화학습 Frozen Lake v1 자동실행 하는 방법

https://github.com/ParkGyeongTae/dqn-atari-breakout/tree/main/3_frozenlake_v0 GitHub - ParkGyeongTae/dqn-atari-breakout Contribute to ParkGyeongTae/dqn-atari-breakout development by creating an account on GitHub. github.com 환경 설정 ### Step 1) 아나콘다 가상환경 만들기 conda create -n py37 python=3.7 ### Step 2) 가상환경 접속 conda activate py37 ### Step 3) 라이브러리 설치 pip install gym==0.23.1 pip install pygame==2.1.2..

Programming Language/Python

[Python] Keras로 생성한 모델 요약 출력하는 방법

from keras.models import Sequential from keras.layers import Dense from tensorflow.keras.optimizers import Adam import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' def build_model(): model = Sequential() model.add(Dense(128, input_dim = 4, activation = 'relu')) model.add(Dense(64, activation = 'relu')) model.add(Dense(32, activation = 'relu')) model.add(Dense(16, activation = 'relu')) model.add(D..

Programming Language/Python

[Python] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA

에러발생 (py37) parkgyeongtae-2:2_cartpole-v1 pgt0409$ python 7_test.py 2022-04-29 13:20:30.672022: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compi..

Programming Language/Python

[Python] ImportError: cannot import name 'Adam' from 'keras.optimizers'

ImportError: cannot import name 'Adam' from 'keras.optimizers' 에러 발생 (py37) parkgyeongtae-2:2_cartpole-v1 pgt0409$ python 7_test.py Traceback (most recent call last): File "7_test.py", line 13, in from keras.optimizers import Adam ImportError: cannot import name 'Adam' from 'keras.optimizers' (/Users/pgt0409/opt/anaconda3/envs/py37/lib/python3.7/site-packages/keras/optimizers.py) 문제 코드 from kera..

Programming Language/Python

[Python] random.randrange(2) 확인해보기

import random for _ in range(10): print(_, random.randrange(2)) import random for _ in range(10): print(_, random.randrange(5)) import random for _ in range(10): print(_, random.randrange(4, 6))

Programming Language/Python

[Python] random.random() 확인하기

random.random() 함수를 알아보자 결과 : 0이상 1미만의 수가 랜덤으로 나온다 import random for _ in range(10): print(_, random.random())

박경태
'Programming Language' 카테고리의 글 목록 (14 Page)