In [6]:
import pandas as pd
import pip
pip.main(['install', 'xlrd'])
input_file = "input/input.xlsx"
df = pd.read_excel(input_file)
comments = df[df.TypeAction == "Comment"]
comments.drop(['Action_id', 'TypeAction'], 1,inplace=True)
comments.head()
Requirement already satisfied (use --upgrade to upgrade): xlrd in /opt/conda/lib/python3.5/site-packages
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:11: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
Out[6]:
Page_name
Feed_message
User_name
CommentsForItem_message
Sentiment
Action_created_time_qvdate
0
Resident Evil
[UK ONLY] To celebrate the release of Resident...
Ronald Briand
Muy buena :) (Y)
0.988
2017-01-05
1
Bandai Namco
We continue our Tales Of look back with Tales ...
Jon Imboden
I may be in the minority here, but I LOVE the ...
0.954
2016-12-27
2
Resident Evil
Are you afraid of the dark? Because you should...
Claudia Alejandra Olguín
mira Roberto Zeballos, para probar en tu PEQU...
0.9527
2017-01-07
3
Resident Evil
[UK ONLY] To celebrate the release of Resident...
David Lawrence
Sarah Amadeus :O
0.9402
2017-01-05
4
Resident Evil
Are you afraid of the dark? Because you should...
Leandro Guilherme
Aeee Paulo Lucas vou te dar de presente no seu...
0.9382
2017-01-08
In [7]:
comments.describe()
Out[7]:
Page_name
Feed_message
User_name
CommentsForItem_message
Sentiment
Action_created_time_qvdate
count
7765
7166
7765
7651
7765
7765
unique
11
91
6965
7504
1302
28
top
Resident Evil
Are you afraid of the dark? Because you should...
-
Tekken 1
-
2017-01-05 00:00:00
freq
3433
1689
26
15
4543
1465
first
NaN
NaN
NaN
NaN
NaN
2015-01-12 00:00:00
last
NaN
NaN
NaN
NaN
NaN
2017-01-10 00:00:00
Content source: HelainSchoonjans/fantastic-eureka
Similar notebooks: