# Series (Collection of values)# DataFrame (Collection of Series Objects)'''
Pandas 读取的 csv 文件会形成一个 DataFrame 数据结构,其中的每行就是一个 Series 数据结构,每列同样是一个 Series 数据结构
'''
1. DataFrame 和 Series 关系
import pandas as pd
fandago = pd.read_csv('fandango_score_comparison.csv')print(type(fandago))
series_film = fandago['FILM']print(type(series_film))print(series_film[0:5])print('---------------')print(fandago['RottenTomatoes'][0:5])
<class 'pandas.core.frame.DataFrame'>
<class 'pandas.core.series.Series'>
0 Avengers: Age of Ultron (2015)
1 Cinderella (2015)
2 Ant-Man (2015)
3 Do You Believe? (2015)
4 Hot Tub Time Machine 2 (2015)
Name: FILM, dtype: object
---------------
0 74
1 85
2 80
3 18
4 14
Name: RottenTomatoes, dtype: int64