#6 미쳐버리겠네, 데이터분석 입문_day6😬
조나 어렵네..
판다스 50번까지 복습(인데도 모르겠음) & 타이타닉 실제 데이터를 가지고 재복습
*pwd : 내가 지금 어디에서 작업하고 있는지 알려주는 것
# Part 1 - Exploring Data
import pandas as pd #데이터테이블 import numpy as np #수치계산
시각화 관련 라이브러리 import matplotlib.pyplot as plt # 시각화 plt.style.use('seaborn-whitegrid') # 스타일 적용 import seaborn as sns # 시각화 import missingno # null값 시각화
#데이터로드
test = pd.read_csv('data_titanic/test.csv') train = pd.read_csv('data_titanic/train.csv')
describe() - to see the data details such as , counts, means and so on.
info() - to see the types of data for each column
len() - len to check the length of the dataframe #몇 개의 데이터 : 행(row)수, 샘플 수
Part 2 - Indexing
train[''] - To see the values of a certain column
isnull().any()/ isna().any() - To check if there are any null values (empty or NaN (Not a Number))
train.loc[train. .values < n] - Locating - loc - To read items with a certain condition
train.iloc[위치:위치2] - iloc - To read certain rows
train.loc[이름:이름2]
Part 3 - Sorting
train.sort_values('Fare', ascending=False) - Sorting columns with descending order
train.sort_values(['Fare', 'Survived', 'Pclass'], ascending=[True, False, False]) - Sorting columns - multi columns in ascending order
train[train['Fare'] > 80] - Sorting a certain column with a certain condition
~32번까지 수업완료