[파이썬_제어문] 반복문 (Loop - for)
조건을 만족하는 동안 작업을 반복적으로 수행하는 반복문이다. 직접 실행시켜본 결과이다. names = ['egoing', 'basta', 'blackdew', 'leezche'] for name in names: print('Hello, '+name+' . Bye, '+name+'.') Hello, egoing . Bye, egoing. Hello, basta . Bye, basta. Hello, blackdew . Bye, blackdew. Hello, leezche . Bye, leezche. persons = [ ['egoing', 'Seoul', 'Web'], ['basta', 'Seoul', 'IOT'], ['blackdew', 'Tongyeong', 'ML'], ] print(persons[0..
2022. 9. 2.
[파이썬] PyPi
판다스를 이용해서 집값에 미치는 요인들을 정리해둔 연습자료로 연습해봤다. import pandas house = pandas.read_csv('house.csv') print(house) print(house.head(2)) print(house.describe()) 방대한 자료인데 순식간에 찾아내는 능력을 보고 놀랐다. crim,zn,indus,chas,nox,rm,age,dis,rad,tax,ptratio,b,lstat,medv 0.00632,18,2.31,0,0.538,6.575,65.2,4.09,1,296,15.3,396.9,4.98,24 0.02731,0,7.07,0,0.469,6.421,78.9,4.9671,2,242,17.8,396.9,9.14,21.6 0.02729,0,7.07,0,0.46..
2022. 9. 1.
[파이썬] 리스트 데이터 타입 (List data type)
2022. 08. 30. 리스트 데이터 타입 파이썬에서 실습한 내용. students = ["egoing", "sori", "maru"] grades = [2,1,4] print("students[1]", students[1]) print("len(students)", len(students)) print("min(grades)", min(grades)) print("min(grades)", max(grades)) print("sum(grades)", sum(grades)) import statistics print("statistics.mean(grades)", statistics.mean(grades)) import random print("random.choice(students)", random...
2022. 9. 1.