Python/Python기초

https://matplotlib.org/ # plotting을 위한 패키지 임포트import matplotlib.pyplot as plt 자료 입력year = [1950, 1960, 1970, 1980, 1990, 2000, 2010]gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3] 그래프 출력# plot: 선 그래프 생성plt.plot(years, gdp, color = 'green', marker = 'o')plt.title('연도별 GDP', fontname='Gulim')plt.xlabel('Year')plt.ylabel('GDP(Billions of $)') # show: 그래프를 화면에 보여주는 기능plt.show() 출력 결과 ..
"""oracle_config.pyOracle 데이터베이스 서버에 접속(로그인)하기 위해 필요한 정보들을 정의""" # 사용자 이름 user = 'scott' # 비밀번호 pwd = 'tiger' # 데이터베이스 서버 주소: DSN(Data Source Name) dsn = 'localhost:1521/orcl' >>Oracle 데이터베이스 서버에서 select 구문 실행, 결과 확인현재 프로젝트 디렉토리 상태 # 사용자가 입력한 문자열에 따옴표(')나 큰따옴표(")가 포함되어 있는 경우# SQL 에러가 발생할 수 있으므로 권장되지 않음.# -> Data Binding 방법을 권장. import cx_Oracleimport lec08_database.oracle_config as cfg with cx_O..
"""oracle_config.pyOracle 데이터베이스 서버에 접속(로그인)하기 위해 필요한 정보들을 정의""" # 사용자 이름 user = 'scott' # 비밀번호 pwd = 'tiger' # 데이터베이스 서버 주소: DSN(Data Source Name) dsn = 'localhost:1521/orcl' >>Oracle 데이터베이스 서버에서 select 구문 실행, 결과 확인현재 프로젝트 디렉토리 상태 >>Insert 구문 실행하기 import cx_Oracleimport lec08_database.oracle_config as cfg # database server와 연결 설정with cx_Oracle.connect(cfg.user, cfg.pwd, cfg.dsn) as connection: ..
# plotting을 위한 패키지 임포트import matplotlib.pyplot as plt # 친구 수friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190] plt.scatter(friends, minutes)plt.title('Minutes vs Friends')plt.xlabel('# of Friends')plt.ylabel('average time(minutes)')plt.show() friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]lab..
Codezoy
'Python/Python기초' 카테고리의 글 목록 (12 Page)