!ls
In [2]:
!ls ./ml
In [4]:
!cat ./ml/movies.csv | wc -l
In [6]:
!head -5 ./ml/movies.csv
In [7]:
!tail -5 ./ml/movies.csv
In [8]:
!head -5 ./ml/ratings.csv
In [10]:
from pandas import *
In [11]:
movies = read_csv('./ml/movies.csv', sep = ',')
In [12]:
type(movies)
Out[12]:
In [14]:
movies.head(15)
Out[14]:
In [20]:
tags = read_csv('./ml/tags.csv', sep = ',')
tags.head()
Out[20]:
In [18]:
ratings = read_csv("./ml/ratings.csv", sep = ",", parse_dates =['timestamp'])
ratings.head()
Out[18]:
In [24]:
del ratings['timestamp']
del tags['timestamp']
In [25]:
row_0 = tags.iloc[0]
type(row_0)
Out[25]:
In [26]:
row_0
Out[26]:
In [28]:
row_0.index
Out[28]:
In [29]:
row_0['userId']
Out[29]:
In [30]:
'rating' in row_0
Out[30]:
In [32]:
tags.head()
Out[32]:
In [33]:
tags.index
Out[33]:
In [34]:
tags.columns
Out[34]:
In [37]:
tags.iloc[[0, 11, 2000]]
Out[37]:
In [ ]:
'Python Library > Pandas' 카테고리의 다른 글
Day 6. Frequent operations with pandas - aggregation (0) | 2019.06.15 |
---|---|
Day 6. Frequent operations with pandas - subsetting, filtering, delegation (0) | 2019.06.15 |
Day 6. Simple visualization with pandas (0) | 2019.06.15 |
Day 6.Movie Data Analysis Part.2 (0) | 2019.06.15 |
Day 5.Pandas (0) | 2019.06.13 |