Notice
Recent Posts
Recent Comments
Link
목록shape (1)
가볍게 배우고 깊게 즐기고 오래 남기기

Pandas 함수 중 DataFrame , Array 형태의 차원 확인을 위한 Shape 함수 titcsv = pd.read_csv('titanic.csv', index_col = 'PassengerId') print(titcsv.shape) # 결과 : (891, 11) print(titcsv.shape[0]) # 결과 : 891 print(titcsv.shape[1]) # 결과 : 11 이 때 Shape의 자체가 Tuple 형태이기 때문에 Shape[0]으로 행의 개수를 , Shape[1]로 열의 개수를 설정 가능하다. len(list)를 반복문 for문돌릴 때 사용하는 것 처럼 df.shape[i]도 반복문이나 타 연산에 사용하는 방향으로 활용하는 것이 스마트한 코딩의 길 + 한 가지 팁 추가 →여..
Programming & Tip/Python
2020. 11. 20. 18:27