Skip to content

Commit d48f90c

Browse files
author
Danyelle Eleusis
committed
d5
1 parent e81fb9d commit d48f90c

File tree

14,313 files changed

+2562417
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

14,313 files changed

+2562417
-0
lines changed
Lines changed: 303 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,303 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import pandas as pd"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 2,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"df = pd.read_csv('feed-views.log', skiprows=[2,3], skipfooter=2, engine='python', names=('datetime', 'user'), index_col='datetime', delimiter='\\t')\n",
19+
"# engine='python' заглушает предупреждение"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": 3,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"df = df.rename_axis('date_time')"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": 4,
34+
"metadata": {},
35+
"outputs": [
36+
{
37+
"data": {
38+
"text/html": [
39+
"<div>\n",
40+
"<style scoped>\n",
41+
" .dataframe tbody tr th:only-of-type {\n",
42+
" vertical-align: middle;\n",
43+
" }\n",
44+
"\n",
45+
" .dataframe tbody tr th {\n",
46+
" vertical-align: top;\n",
47+
" }\n",
48+
"\n",
49+
" .dataframe thead th {\n",
50+
" text-align: right;\n",
51+
" }\n",
52+
"</style>\n",
53+
"<table border=\"1\" class=\"dataframe\">\n",
54+
" <thead>\n",
55+
" <tr style=\"text-align: right;\">\n",
56+
" <th></th>\n",
57+
" <th>user</th>\n",
58+
" </tr>\n",
59+
" <tr>\n",
60+
" <th>date_time</th>\n",
61+
" <th></th>\n",
62+
" </tr>\n",
63+
" </thead>\n",
64+
" <tbody>\n",
65+
" <tr>\n",
66+
" <th>2020-04-17 12:01:08.463179</th>\n",
67+
" <td>artem</td>\n",
68+
" </tr>\n",
69+
" <tr>\n",
70+
" <th>2020-04-17 12:01:23.743946</th>\n",
71+
" <td>artem</td>\n",
72+
" </tr>\n",
73+
" <tr>\n",
74+
" <th>2020-04-17 12:35:52.735016</th>\n",
75+
" <td>artem</td>\n",
76+
" </tr>\n",
77+
" <tr>\n",
78+
" <th>2020-04-17 12:36:21.401412</th>\n",
79+
" <td>oksana</td>\n",
80+
" </tr>\n",
81+
" <tr>\n",
82+
" <th>2020-04-17 12:36:22.023355</th>\n",
83+
" <td>oksana</td>\n",
84+
" </tr>\n",
85+
" </tbody>\n",
86+
"</table>\n",
87+
"</div>"
88+
],
89+
"text/plain": [
90+
" user\n",
91+
"date_time \n",
92+
"2020-04-17 12:01:08.463179 artem\n",
93+
"2020-04-17 12:01:23.743946 artem\n",
94+
"2020-04-17 12:35:52.735016 artem\n",
95+
"2020-04-17 12:36:21.401412 oksana\n",
96+
"2020-04-17 12:36:22.023355 oksana"
97+
]
98+
},
99+
"execution_count": 4,
100+
"metadata": {},
101+
"output_type": "execute_result"
102+
}
103+
],
104+
"source": [
105+
"df.head()"
106+
]
107+
},
108+
{
109+
"cell_type": "code",
110+
"execution_count": 5,
111+
"metadata": {},
112+
"outputs": [],
113+
"source": [
114+
"df.to_csv(sep=';', path_or_buf='feed-views-semicolon.log')"
115+
]
116+
},
117+
{
118+
"cell_type": "code",
119+
"execution_count": 6,
120+
"metadata": {},
121+
"outputs": [
122+
{
123+
"data": {
124+
"text/html": [
125+
"<div>\n",
126+
"<style scoped>\n",
127+
" .dataframe tbody tr th:only-of-type {\n",
128+
" vertical-align: middle;\n",
129+
" }\n",
130+
"\n",
131+
" .dataframe tbody tr th {\n",
132+
" vertical-align: top;\n",
133+
" }\n",
134+
"\n",
135+
" .dataframe thead th {\n",
136+
" text-align: right;\n",
137+
" }\n",
138+
"</style>\n",
139+
"<table border=\"1\" class=\"dataframe\">\n",
140+
" <thead>\n",
141+
" <tr style=\"text-align: right;\">\n",
142+
" <th></th>\n",
143+
" <th>user</th>\n",
144+
" </tr>\n",
145+
" <tr>\n",
146+
" <th>date_time</th>\n",
147+
" <th></th>\n",
148+
" </tr>\n",
149+
" </thead>\n",
150+
" <tbody>\n",
151+
" <tr>\n",
152+
" <th>2020-04-17 12:01:08.463179</th>\n",
153+
" <td>artem</td>\n",
154+
" </tr>\n",
155+
" <tr>\n",
156+
" <th>2020-04-17 12:01:23.743946</th>\n",
157+
" <td>artem</td>\n",
158+
" </tr>\n",
159+
" <tr>\n",
160+
" <th>2020-04-17 12:35:52.735016</th>\n",
161+
" <td>artem</td>\n",
162+
" </tr>\n",
163+
" <tr>\n",
164+
" <th>2020-04-17 12:36:21.401412</th>\n",
165+
" <td>oksana</td>\n",
166+
" </tr>\n",
167+
" <tr>\n",
168+
" <th>2020-04-17 12:36:22.023355</th>\n",
169+
" <td>oksana</td>\n",
170+
" </tr>\n",
171+
" </tbody>\n",
172+
"</table>\n",
173+
"</div>"
174+
],
175+
"text/plain": [
176+
" user\n",
177+
"date_time \n",
178+
"2020-04-17 12:01:08.463179 artem\n",
179+
"2020-04-17 12:01:23.743946 artem\n",
180+
"2020-04-17 12:35:52.735016 artem\n",
181+
"2020-04-17 12:36:21.401412 oksana\n",
182+
"2020-04-17 12:36:22.023355 oksana"
183+
]
184+
},
185+
"execution_count": 6,
186+
"metadata": {},
187+
"output_type": "execute_result"
188+
}
189+
],
190+
"source": [
191+
"df.head()"
192+
]
193+
},
194+
{
195+
"cell_type": "code",
196+
"execution_count": 7,
197+
"metadata": {},
198+
"outputs": [
199+
{
200+
"data": {
201+
"text/html": [
202+
"<div>\n",
203+
"<style scoped>\n",
204+
" .dataframe tbody tr th:only-of-type {\n",
205+
" vertical-align: middle;\n",
206+
" }\n",
207+
"\n",
208+
" .dataframe tbody tr th {\n",
209+
" vertical-align: top;\n",
210+
" }\n",
211+
"\n",
212+
" .dataframe thead th {\n",
213+
" text-align: right;\n",
214+
" }\n",
215+
"</style>\n",
216+
"<table border=\"1\" class=\"dataframe\">\n",
217+
" <thead>\n",
218+
" <tr style=\"text-align: right;\">\n",
219+
" <th></th>\n",
220+
" <th>user</th>\n",
221+
" </tr>\n",
222+
" <tr>\n",
223+
" <th>date_time</th>\n",
224+
" <th></th>\n",
225+
" </tr>\n",
226+
" </thead>\n",
227+
" <tbody>\n",
228+
" <tr>\n",
229+
" <th>2020-05-21 16:36:40.915488</th>\n",
230+
" <td>ekaterina</td>\n",
231+
" </tr>\n",
232+
" <tr>\n",
233+
" <th>2020-05-21 17:49:36.429237</th>\n",
234+
" <td>maxim</td>\n",
235+
" </tr>\n",
236+
" <tr>\n",
237+
" <th>2020-05-21 18:45:20.441142</th>\n",
238+
" <td>valentina</td>\n",
239+
" </tr>\n",
240+
" <tr>\n",
241+
" <th>2020-05-21 23:03:06.457819</th>\n",
242+
" <td>maxim</td>\n",
243+
" </tr>\n",
244+
" <tr>\n",
245+
" <th>2020-05-21 23:23:49.995349</th>\n",
246+
" <td>pavel</td>\n",
247+
" </tr>\n",
248+
" </tbody>\n",
249+
"</table>\n",
250+
"</div>"
251+
],
252+
"text/plain": [
253+
" user\n",
254+
"date_time \n",
255+
"2020-05-21 16:36:40.915488 ekaterina\n",
256+
"2020-05-21 17:49:36.429237 maxim\n",
257+
"2020-05-21 18:45:20.441142 valentina\n",
258+
"2020-05-21 23:03:06.457819 maxim\n",
259+
"2020-05-21 23:23:49.995349 pavel"
260+
]
261+
},
262+
"execution_count": 7,
263+
"metadata": {},
264+
"output_type": "execute_result"
265+
}
266+
],
267+
"source": [
268+
"df.tail()"
269+
]
270+
},
271+
{
272+
"cell_type": "code",
273+
"execution_count": null,
274+
"metadata": {},
275+
"outputs": [],
276+
"source": []
277+
}
278+
],
279+
"metadata": {
280+
"interpreter": {
281+
"hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad"
282+
},
283+
"kernelspec": {
284+
"display_name": "Python 3 (ipykernel)",
285+
"language": "python",
286+
"name": "python3"
287+
},
288+
"language_info": {
289+
"codemirror_mode": {
290+
"name": "ipython",
291+
"version": 3
292+
},
293+
"file_extension": ".py",
294+
"mimetype": "text/x-python",
295+
"name": "python",
296+
"nbconvert_exporter": "python",
297+
"pygments_lexer": "ipython3",
298+
"version": "3.9.10"
299+
}
300+
},
301+
"nbformat": 4,
302+
"nbformat_minor": 2
303+
}

0 commit comments

Comments
 (0)