pandas 커맨드 중 괄호()를 사용 하는 것과 그렇지 않는 것의 구분

Q03

pandas 커맨드 중 괄호() 로 끝나는 것과 그렇지 않은 것

In [1]:
import pandas as pd
In [3]:
movies = pd.read_csv('http://bit.ly/imdbratings')
In [4]:
movies.head()
Out[4]:
star_rating title content_rating genre duration actors_list
0 9.3 The Shawshank Redemption R Crime 142 [u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...
1 9.2 The Godfather R Crime 175 [u'Marlon Brando', u'Al Pacino', u'James Caan']
2 9.1 The Godfather: Part II R Crime 200 [u'Al Pacino', u'Robert De Niro', u'Robert Duv...
3 9.0 The Dark Knight PG-13 Action 152 [u'Christian Bale', u'Heath Ledger', u'Aaron E...
4 8.9 Pulp Fiction R Crime 154 [u'John Travolta', u'Uma Thurman', u'Samuel L....
In [5]:
movies.describe()
Out[5]:
star_rating duration
count 979.000000 979.000000
mean 7.889785 120.979571
std 0.336069 26.218010
min 7.400000 64.000000
25% 7.600000 102.000000
50% 7.800000 117.000000
75% 8.100000 134.000000
max 9.300000 242.000000
In [6]:
movies.shape
Out[6]:
(979, 6)
In [8]:
movies.dtypes
Out[8]:
star_rating       float64
title              object
content_rating     object
genre              object
duration            int64
actors_list        object
dtype: object
In [9]:
type(movies)
Out[9]:
pandas.core.frame.DataFrame

attribute 는 괄호 없이,

actionc 기반의 method 는 괄호를 사용 한다.

In [ ]:
### 괄호 안에서 shift tab 을 4회 이내로 눌러보면 도움말이 상세히 표시 된다.

댓글

Designed by JB FACTORY