
date_str = ["2020, 1, 1", "2020, 1, 3", "2020, 1, 5", "2020, 1, 7"]
idx = pd.to_datetime(date_str)
idx
print(pd.date_range("2020-1-1", "2020-1-15")) # 1월1일부터 1월15일까지의 시간 범위
print(pd.date_range(start="2020-1-1", periods=15)) # 1월1일부터 15일간의 시간 범위
def plus(x):
return x.sepal_length + x.petal_length # iris의 길이를 모두 더함
iris['length_sum'] = iris.apply(plus,axis=1) #인자로 plus 함수를 넣는다.
iris.length_sum.head()
iris.assign(length_sum=lambda x:x.sepal_length + x.petal_length) #인자로 새로운 열 이름과 수식을 제공
iris.length_sum.head()
Titanic Dataset


Titanic 데이터 불러오기
import seaborn as sns
data = sns.load_dataset('titanic') #titanic 데이터셋 불러오기
data.head()

titanic.info()

Titanic 데이터 분석 Missions
1. 중복치 처리를 진행해보자
2. 결측치를 처리해보자
3. 각 숫자형 데이터들의 통계치를 구해보자
4. Category 형 데이터에 groupby를 적용해보자
5. String Type 열에도 agg()를 적용해보자
6. Cabin을 여러개의 열로 분할해보자
7. 나만의 경향성을 찾아보자