Bootcamp/Pandas & python

[Pandas] Pandas 심화

K_Hyul 2023. 10. 11. 16:18
728x90

7일차에서 numpy와 pandas 기초를 했다.

오늘은 Pandas 심화 과정을 가져왔다.

 

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm

df = sns.load_dataset('titanic')

print(df.isnull()) # null 값 계산
print(df.isnull().sum()) # null을 각 행마다 수
print(df.info()) # column 당 각각의 수
print(df.shape[0]) # 요소 수
print((df.isnull().sum() / (len(df)) * 100).round(2)) # round(2) : 소수점 2째자리 까지
728x90