Starting with question 2, as it helps with question 1.
Various of the columns represent dates or datetimes, but out of the box pd.read_table
won't treat them correctly. This makes it hard to (for example) compute the number of rentals by month. Fix the dates and compute the number of rentals by month.
In [2]:
import pandas as pd
In [3]:
weather = pd.read_table('daily_weather.tsv')
In [4]:
weather
Out[4]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Spring
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Spring
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [5]:
type(weather.date)
Out[5]:
pandas.core.series.Series
In [7]:
pd.Series.replace(weather.date, pd.to_datetime(pd.Series(weather.date)), inplace=True)
In [8]:
type(weather.date[0])
Out[8]:
str
In [9]:
pd.Series.replace(weather.date, pd.to_datetime(pd.Series(weather.date)))
Out[9]:
0 2012-01-01
1 2012-01-02
2 2012-01-03
3 2012-01-04
4 2012-01-05
5 2012-01-06
6 2012-01-07
7 2012-01-08
8 2012-01-09
9 2012-01-10
10 2012-01-11
11 2012-01-12
12 2012-01-13
13 2012-01-14
14 2012-01-15
15 2012-01-16
16 2012-01-17
17 2012-01-18
18 2012-01-19
19 2012-01-20
20 2012-01-21
21 2012-01-22
22 2012-01-23
23 2012-01-24
24 2012-01-25
25 2012-01-26
26 2012-01-27
27 2012-01-28
28 2012-01-29
29 2012-01-30
...
336 2012-12-02
337 2012-12-03
338 2012-12-04
339 2012-12-05
340 2012-12-06
341 2012-12-07
342 2012-12-08
343 2012-12-09
344 2012-12-10
345 2012-12-11
346 2012-12-12
347 2012-12-13
348 2012-12-14
349 2012-12-15
350 2012-12-16
351 2012-12-17
352 2012-12-18
353 2012-12-19
354 2012-12-20
355 2012-12-21
356 2012-12-22
357 2012-12-23
358 2012-12-24
359 2012-12-25
360 2012-12-26
361 2012-12-27
362 2012-12-28
363 2012-12-29
364 2012-12-30
365 2012-12-31
Name: date, dtype: object
In [10]:
type(weather.date[0])
Out[10]:
str
In [11]:
type(weather.date)
Out[11]:
pandas.core.series.Series
In [13]:
type(weather)
Out[13]:
pandas.core.frame.DataFrame
In [16]:
weather['date'] = pd.to_datetime(weather['date'])
In [17]:
weather.date[0]
Out[17]:
Timestamp('2012-01-01 00:00:00')
Compute the average temperature by season ('season_desc'). (The temperatures are numbers between 0 and 1, but don't worry about that. Let's say that's the Shellman temperature scale.)
I get
season_desc
Fall 0.711445
Spring 0.321700
Summer 0.554557
Winter 0.419368
Which clearly looks wrong. Figure out what's wrong with the original data and fix it.
In [18]:
weather.date[1:]
Out[18]:
1 2012-01-02
2 2012-01-03
3 2012-01-04
4 2012-01-05
5 2012-01-06
6 2012-01-07
7 2012-01-08
8 2012-01-09
9 2012-01-10
10 2012-01-11
11 2012-01-12
12 2012-01-13
13 2012-01-14
14 2012-01-15
15 2012-01-16
16 2012-01-17
17 2012-01-18
18 2012-01-19
19 2012-01-20
20 2012-01-21
21 2012-01-22
22 2012-01-23
23 2012-01-24
24 2012-01-25
25 2012-01-26
26 2012-01-27
27 2012-01-28
28 2012-01-29
29 2012-01-30
30 2012-01-31
...
336 2012-12-02
337 2012-12-03
338 2012-12-04
339 2012-12-05
340 2012-12-06
341 2012-12-07
342 2012-12-08
343 2012-12-09
344 2012-12-10
345 2012-12-11
346 2012-12-12
347 2012-12-13
348 2012-12-14
349 2012-12-15
350 2012-12-16
351 2012-12-17
352 2012-12-18
353 2012-12-19
354 2012-12-20
355 2012-12-21
356 2012-12-22
357 2012-12-23
358 2012-12-24
359 2012-12-25
360 2012-12-26
361 2012-12-27
362 2012-12-28
363 2012-12-29
364 2012-12-30
365 2012-12-31
Name: date, dtype: datetime64[ns]
In [19]:
weather.date[:1]
Out[19]:
0 2012-01-01
Name: date, dtype: datetime64[ns]
In [20]:
weather.date[:60]
Out[20]:
0 2012-01-01
1 2012-01-02
2 2012-01-03
3 2012-01-04
4 2012-01-05
5 2012-01-06
6 2012-01-07
7 2012-01-08
8 2012-01-09
9 2012-01-10
10 2012-01-11
11 2012-01-12
12 2012-01-13
13 2012-01-14
14 2012-01-15
15 2012-01-16
16 2012-01-17
17 2012-01-18
18 2012-01-19
19 2012-01-20
20 2012-01-21
21 2012-01-22
22 2012-01-23
23 2012-01-24
24 2012-01-25
25 2012-01-26
26 2012-01-27
27 2012-01-28
28 2012-01-29
29 2012-01-30
30 2012-01-31
31 2012-02-01
32 2012-02-02
33 2012-02-03
34 2012-02-04
35 2012-02-05
36 2012-02-06
37 2012-02-07
38 2012-02-08
39 2012-02-09
40 2012-02-10
41 2012-02-11
42 2012-02-12
43 2012-02-13
44 2012-02-14
45 2012-02-15
46 2012-02-16
47 2012-02-17
48 2012-02-18
49 2012-02-19
50 2012-02-20
51 2012-02-21
52 2012-02-22
53 2012-02-23
54 2012-02-24
55 2012-02-25
56 2012-02-26
57 2012-02-27
58 2012-02-28
59 2012-02-29
Name: date, dtype: datetime64[ns]
In [21]:
weather.date[:60][weather.season_desc == 'Spring']
Out[21]:
0 2012-01-01
1 2012-01-02
2 2012-01-03
3 2012-01-04
4 2012-01-05
5 2012-01-06
6 2012-01-07
7 2012-01-08
8 2012-01-09
9 2012-01-10
10 2012-01-11
11 2012-01-12
12 2012-01-13
13 2012-01-14
14 2012-01-15
15 2012-01-16
16 2012-01-17
17 2012-01-18
18 2012-01-19
19 2012-01-20
20 2012-01-21
21 2012-01-22
22 2012-01-23
23 2012-01-24
24 2012-01-25
25 2012-01-26
26 2012-01-27
27 2012-01-28
28 2012-01-29
29 2012-01-30
30 2012-01-31
31 2012-02-01
32 2012-02-02
33 2012-02-03
34 2012-02-04
35 2012-02-05
36 2012-02-06
37 2012-02-07
38 2012-02-08
39 2012-02-09
40 2012-02-10
41 2012-02-11
42 2012-02-12
43 2012-02-13
44 2012-02-14
45 2012-02-15
46 2012-02-16
47 2012-02-17
48 2012-02-18
49 2012-02-19
50 2012-02-20
51 2012-02-21
52 2012-02-22
53 2012-02-23
54 2012-02-24
55 2012-02-25
56 2012-02-26
57 2012-02-27
58 2012-02-28
59 2012-02-29
Name: date, dtype: datetime64[ns]
In [22]:
weather
Out[22]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Spring
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Spring
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [23]:
weather.date[:60][weather.season_desc == 'Winter']
Out[23]:
Series([], Name: date, dtype: datetime64[ns])
In [24]:
weather
Out[24]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
1
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Spring
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Spring
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [25]:
weather.season_desc[:60] = 'Winter'
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [26]:
weather
Out[26]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
1
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
1
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Spring
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Spring
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [28]:
weather[60:152]
Out[28]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
60
2012-03-01
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.485833
0.475371
0.615417
0.226987
325
4665
4990
61
2012-03-02
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.359842
0.657083
0.144904
246
2948
3194
62
2012-03-03
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.414167
0.413492
0.621250
0.161079
956
3110
4066
63
2012-03-04
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.325833
0.303021
0.403333
0.334571
710
2713
3423
64
2012-03-05
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.243333
0.241171
0.506250
0.228858
203
3130
3333
65
2012-03-06
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.258333
0.255042
0.456667
0.200875
221
3735
3956
66
2012-03-07
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.404167
0.385100
0.513333
0.345779
432
4484
4916
67
2012-03-08
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.527500
0.524604
0.567500
0.441563
486
4896
5382
68
2012-03-09
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.410833
0.397083
0.407083
0.414800
447
4122
4569
69
2012-03-10
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.287500
0.277767
0.350417
0.225750
968
3150
4118
70
2012-03-11
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.361739
0.359670
0.476957
0.222587
1658
3253
4911
71
2012-03-12
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.466667
0.459592
0.489167
0.207713
838
4460
5298
72
2012-03-13
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.565000
0.542929
0.617500
0.236950
762
5085
5847
73
2012-03-14
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.572500
0.548617
0.507083
0.115062
997
5315
6312
74
2012-03-15
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.557500
0.532825
0.579583
0.149883
1005
5187
6192
75
2012-03-16
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.436229
0.842083
0.113192
548
3830
4378
76
2012-03-17
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.514167
0.505046
0.755833
0.110704
3155
4681
7836
77
2012-03-18
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.472500
0.464000
0.810000
0.126883
2207
3685
5892
78
2012-03-19
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.545000
0.532821
0.728750
0.162317
982
5171
6153
79
2012-03-20
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.560833
0.538533
0.807917
0.121271
1051
5042
6093
80
2012-03-21
3
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.531667
0.513258
0.821250
0.089558
1122
5108
6230
81
2012-03-22
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.554167
0.531567
0.831250
0.117562
1334
5537
6871
82
2012-03-23
5
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.601667
0.570067
0.694167
0.116300
2469
5893
8362
83
2012-03-24
6
2
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.502500
0.486733
0.885417
0.192783
1033
2339
3372
84
2012-03-25
0
2
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.437500
0.437488
0.880833
0.220775
1532
3464
4996
85
2012-03-26
1
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.445833
0.438750
0.477917
0.386821
795
4763
5558
86
2012-03-27
2
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.323333
0.315654
0.290000
0.187192
531
4571
5102
87
2012-03-28
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.484167
0.470950
0.481250
0.291671
674
5024
5698
88
2012-03-29
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.494167
0.482304
0.439167
0.319650
834
5299
6133
89
2012-03-30
5
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.370000
0.375621
0.580833
0.138067
796
4663
5459
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
122
2012-05-02
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.537896
0.797083
0.138058
667
5502
6169
123
2012-05-03
4
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.560000
0.537242
0.768333
0.133696
764
5657
6421
124
2012-05-04
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.627500
0.590917
0.735417
0.162938
1069
5227
6296
125
2012-05-05
6
2
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.621667
0.584608
0.756667
0.152992
2496
4387
6883
126
2012-05-06
0
2
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.562500
0.546737
0.740000
0.149879
2135
4224
6359
127
2012-05-07
1
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.537500
0.527142
0.664167
0.230721
1008
5265
6273
128
2012-05-08
2
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.581667
0.557471
0.685833
0.296029
738
4990
5728
129
2012-05-09
3
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.575000
0.553025
0.744167
0.216412
620
4097
4717
130
2012-05-10
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.505833
0.491783
0.552083
0.314063
1026
5546
6572
131
2012-05-11
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.533333
0.520833
0.360417
0.236937
1319
5711
7030
132
2012-05-12
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.544817
0.480417
0.123133
2622
4807
7429
133
2012-05-13
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.612500
0.585238
0.576250
0.225117
2172
3946
6118
134
2012-05-14
1
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.573333
0.549900
0.789583
0.212692
342
2501
2843
135
2012-05-15
2
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.611667
0.576404
0.794583
0.147392
625
4490
5115
136
2012-05-16
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.636667
0.595975
0.697917
0.122512
991
6433
7424
137
2012-05-17
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.593333
0.572613
0.520000
0.229475
1242
6142
7384
138
2012-05-18
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.551121
0.523333
0.136817
1521
6118
7639
139
2012-05-19
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.600000
0.566908
0.456250
0.083975
3410
4884
8294
140
2012-05-20
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.620833
0.583967
0.530417
0.254367
2704
4425
7129
141
2012-05-21
1
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.598333
0.565667
0.811250
0.233204
630
3729
4359
142
2012-05-22
2
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.615000
0.580825
0.765833
0.118167
819
5254
6073
143
2012-05-23
3
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.621667
0.584612
0.774583
0.102000
766
4494
5260
144
2012-05-24
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.655000
0.606700
0.716667
0.172896
1059
5711
6770
145
2012-05-25
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.680000
0.627529
0.747083
0.140550
1417
5317
6734
146
2012-05-26
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.692500
0.642696
0.732500
0.198992
2855
3681
6536
147
2012-05-27
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.690000
0.641425
0.697083
0.215171
3283
3308
6591
148
2012-05-28
1
2
Summer
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.712500
0.679300
0.676250
0.196521
2557
3486
6043
149
2012-05-29
2
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.722500
0.672992
0.684583
0.295400
880
4863
5743
150
2012-05-30
3
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.656667
0.611129
0.670000
0.134329
745
6110
6855
151
2012-05-31
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.680000
0.631329
0.492917
0.195279
1100
6238
7338
92 rows × 15 columns
In [29]:
weather.season_desc[60:152] = 'Spring'
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [30]:
weather[60:152]
Out[30]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
60
2012-03-01
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.485833
0.475371
0.615417
0.226987
325
4665
4990
61
2012-03-02
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.359842
0.657083
0.144904
246
2948
3194
62
2012-03-03
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.414167
0.413492
0.621250
0.161079
956
3110
4066
63
2012-03-04
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.325833
0.303021
0.403333
0.334571
710
2713
3423
64
2012-03-05
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.243333
0.241171
0.506250
0.228858
203
3130
3333
65
2012-03-06
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.258333
0.255042
0.456667
0.200875
221
3735
3956
66
2012-03-07
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.404167
0.385100
0.513333
0.345779
432
4484
4916
67
2012-03-08
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.527500
0.524604
0.567500
0.441563
486
4896
5382
68
2012-03-09
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.410833
0.397083
0.407083
0.414800
447
4122
4569
69
2012-03-10
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.287500
0.277767
0.350417
0.225750
968
3150
4118
70
2012-03-11
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.361739
0.359670
0.476957
0.222587
1658
3253
4911
71
2012-03-12
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.466667
0.459592
0.489167
0.207713
838
4460
5298
72
2012-03-13
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.565000
0.542929
0.617500
0.236950
762
5085
5847
73
2012-03-14
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.572500
0.548617
0.507083
0.115062
997
5315
6312
74
2012-03-15
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.557500
0.532825
0.579583
0.149883
1005
5187
6192
75
2012-03-16
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.436229
0.842083
0.113192
548
3830
4378
76
2012-03-17
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.514167
0.505046
0.755833
0.110704
3155
4681
7836
77
2012-03-18
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.472500
0.464000
0.810000
0.126883
2207
3685
5892
78
2012-03-19
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.545000
0.532821
0.728750
0.162317
982
5171
6153
79
2012-03-20
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.560833
0.538533
0.807917
0.121271
1051
5042
6093
80
2012-03-21
3
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.531667
0.513258
0.821250
0.089558
1122
5108
6230
81
2012-03-22
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.554167
0.531567
0.831250
0.117562
1334
5537
6871
82
2012-03-23
5
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.601667
0.570067
0.694167
0.116300
2469
5893
8362
83
2012-03-24
6
2
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.502500
0.486733
0.885417
0.192783
1033
2339
3372
84
2012-03-25
0
2
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.437500
0.437488
0.880833
0.220775
1532
3464
4996
85
2012-03-26
1
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.445833
0.438750
0.477917
0.386821
795
4763
5558
86
2012-03-27
2
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.323333
0.315654
0.290000
0.187192
531
4571
5102
87
2012-03-28
3
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.484167
0.470950
0.481250
0.291671
674
5024
5698
88
2012-03-29
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.494167
0.482304
0.439167
0.319650
834
5299
6133
89
2012-03-30
5
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.370000
0.375621
0.580833
0.138067
796
4663
5459
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
122
2012-05-02
3
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.537896
0.797083
0.138058
667
5502
6169
123
2012-05-03
4
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.560000
0.537242
0.768333
0.133696
764
5657
6421
124
2012-05-04
5
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.627500
0.590917
0.735417
0.162938
1069
5227
6296
125
2012-05-05
6
2
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.621667
0.584608
0.756667
0.152992
2496
4387
6883
126
2012-05-06
0
2
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.562500
0.546737
0.740000
0.149879
2135
4224
6359
127
2012-05-07
1
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.537500
0.527142
0.664167
0.230721
1008
5265
6273
128
2012-05-08
2
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.581667
0.557471
0.685833
0.296029
738
4990
5728
129
2012-05-09
3
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.575000
0.553025
0.744167
0.216412
620
4097
4717
130
2012-05-10
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.505833
0.491783
0.552083
0.314063
1026
5546
6572
131
2012-05-11
5
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.533333
0.520833
0.360417
0.236937
1319
5711
7030
132
2012-05-12
6
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.544817
0.480417
0.123133
2622
4807
7429
133
2012-05-13
0
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.612500
0.585238
0.576250
0.225117
2172
3946
6118
134
2012-05-14
1
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.573333
0.549900
0.789583
0.212692
342
2501
2843
135
2012-05-15
2
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.611667
0.576404
0.794583
0.147392
625
4490
5115
136
2012-05-16
3
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.636667
0.595975
0.697917
0.122512
991
6433
7424
137
2012-05-17
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.593333
0.572613
0.520000
0.229475
1242
6142
7384
138
2012-05-18
5
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.564167
0.551121
0.523333
0.136817
1521
6118
7639
139
2012-05-19
6
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.600000
0.566908
0.456250
0.083975
3410
4884
8294
140
2012-05-20
0
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.620833
0.583967
0.530417
0.254367
2704
4425
7129
141
2012-05-21
1
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.598333
0.565667
0.811250
0.233204
630
3729
4359
142
2012-05-22
2
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.615000
0.580825
0.765833
0.118167
819
5254
6073
143
2012-05-23
3
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.621667
0.584612
0.774583
0.102000
766
4494
5260
144
2012-05-24
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.655000
0.606700
0.716667
0.172896
1059
5711
6770
145
2012-05-25
5
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.680000
0.627529
0.747083
0.140550
1417
5317
6734
146
2012-05-26
6
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.692500
0.642696
0.732500
0.198992
2855
3681
6536
147
2012-05-27
0
2
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.690000
0.641425
0.697083
0.215171
3283
3308
6591
148
2012-05-28
1
2
Spring
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.712500
0.679300
0.676250
0.196521
2557
3486
6043
149
2012-05-29
2
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.722500
0.672992
0.684583
0.295400
880
4863
5743
150
2012-05-30
3
2
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.656667
0.611129
0.670000
0.134329
745
6110
6855
151
2012-05-31
4
2
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.680000
0.631329
0.492917
0.195279
1100
6238
7338
92 rows × 15 columns
In [31]:
weather.season_desc[152:244] = 'Summer'
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [32]:
weather[152:244]
Out[32]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
152
2012-06-01
5
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.654167
0.607962
0.755417
0.237563
533
3594
4127
153
2012-06-02
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.583333
0.566288
0.549167
0.186562
2795
5325
8120
154
2012-06-03
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.602500
0.575133
0.493333
0.184087
2494
5147
7641
155
2012-06-04
1
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.597500
0.578283
0.487083
0.284833
1071
5927
6998
156
2012-06-05
2
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.540833
0.525892
0.613333
0.209575
968
6033
7001
157
2012-06-06
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.554167
0.542292
0.611250
0.077125
1027
6028
7055
158
2012-06-07
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.602500
0.569442
0.567083
0.157350
1038
6456
7494
159
2012-06-08
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.649167
0.597862
0.467917
0.175383
1488
6248
7736
160
2012-06-09
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.710833
0.648367
0.437083
0.144287
2708
4790
7498
161
2012-06-10
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.726667
0.663517
0.538333
0.133721
2224
4374
6598
162
2012-06-11
1
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.720833
0.659721
0.587917
0.207713
1017
5647
6664
163
2012-06-12
2
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.653333
0.597875
0.833333
0.214546
477
4495
4972
164
2012-06-13
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.655833
0.611117
0.582083
0.343279
1173
6248
7421
165
2012-06-14
4
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.648333
0.624383
0.569583
0.253733
1180
6183
7363
166
2012-06-15
5
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.639167
0.599754
0.589583
0.176617
1563
6102
7665
167
2012-06-16
6
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.631667
0.594708
0.504167
0.166667
2963
4739
7702
168
2012-06-17
0
2
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.592500
0.571975
0.598750
0.144904
2634
4344
6978
169
2012-06-18
1
2
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.568333
0.544842
0.777917
0.174746
653
4446
5099
170
2012-06-19
2
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.688333
0.654692
0.690000
0.148017
968
5857
6825
171
2012-06-20
3
2
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.782500
0.720975
0.592083
0.113812
872
5339
6211
172
2012-06-21
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.805833
0.752542
0.567917
0.118787
778
5127
5905
173
2012-06-22
5
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.777500
0.724121
0.573750
0.182842
964
4859
5823
174
2012-06-23
6
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.731667
0.652792
0.534583
0.179721
2657
4801
7458
175
2012-06-24
0
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.743333
0.674254
0.479167
0.145525
2551
4340
6891
176
2012-06-25
1
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.715833
0.654042
0.504167
0.300383
1139
5640
6779
177
2012-06-26
2
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.630833
0.594704
0.373333
0.347642
1077
6365
7442
178
2012-06-27
3
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.697500
0.640792
0.360000
0.271775
1077
6258
7335
179
2012-06-28
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.749167
0.675512
0.422500
0.171650
921
5958
6879
180
2012-06-29
5
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.834167
0.786613
0.488750
0.165417
829
4634
5463
181
2012-06-30
6
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.765000
0.687508
0.601250
0.161071
1455
4232
5687
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
214
2012-08-02
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.752500
0.707088
0.659583
0.129354
983
6278
7261
215
2012-08-03
5
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.765833
0.722867
0.642500
0.215792
1328
5847
7175
216
2012-08-04
6
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.793333
0.751267
0.613333
0.257458
2345
4479
6824
217
2012-08-05
0
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.769167
0.731079
0.652500
0.290421
1707
3757
5464
218
2012-08-06
1
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.752500
0.710246
0.654167
0.129354
1233
5780
7013
219
2012-08-07
2
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.735833
0.697621
0.703750
0.116908
1278
5995
7273
220
2012-08-08
3
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.750000
0.707717
0.672917
0.110700
1263
6271
7534
221
2012-08-09
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.755833
0.699508
0.620417
0.156100
1196
6090
7286
222
2012-08-10
5
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.715833
0.667942
0.715833
0.238813
1065
4721
5786
223
2012-08-11
6
3
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.692500
0.638267
0.732917
0.206479
2247
4052
6299
224
2012-08-12
0
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.700833
0.644579
0.530417
0.122512
2182
4362
6544
225
2012-08-13
1
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.720833
0.662254
0.545417
0.136212
1207
5676
6883
226
2012-08-14
2
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.726667
0.676779
0.686667
0.169158
1128
5656
6784
227
2012-08-15
3
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.706667
0.654037
0.619583
0.169771
1198
6149
7347
228
2012-08-16
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.719167
0.654688
0.519167
0.141796
1338
6267
7605
229
2012-08-17
5
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.723333
0.242400
0.570833
0.231354
1483
5665
7148
230
2012-08-18
6
3
Summer
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.678333
0.618071
0.603333
0.177867
2827
5038
7865
231
2012-08-19
0
3
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.635833
0.603554
0.711667
0.086450
1208
3341
4549
232
2012-08-20
1
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.635833
0.595967
0.734167
0.129979
1026
5504
6530
233
2012-08-21
2
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.649167
0.601025
0.673750
0.072771
1081
5925
7006
234
2012-08-22
3
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.667500
0.621854
0.677083
0.070283
1094
6281
7375
235
2012-08-23
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.695833
0.637008
0.635833
0.084596
1363
6402
7765
236
2012-08-24
5
3
Summer
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.702500
0.647100
0.615000
0.072146
1325
6257
7582
237
2012-08-25
6
3
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.661667
0.618696
0.712917
0.244408
1829
4224
6053
238
2012-08-26
0
3
Summer
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.653333
0.595996
0.845833
0.228858
1483
3772
5255
239
2012-08-27
1
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.703333
0.654688
0.730417
0.128733
989
5928
6917
240
2012-08-28
2
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.728333
0.666050
0.620000
0.190925
935
6105
7040
241
2012-08-29
3
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.685000
0.635733
0.552083
0.112562
1177
6520
7697
242
2012-08-30
4
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.706667
0.652779
0.590417
0.077117
1172
6541
7713
243
2012-08-31
5
3
Summer
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.764167
0.689400
0.587500
0.168533
1433
5917
7350
92 rows × 15 columns
In [33]:
weather.season_desc[244:335] = 'Fall'
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [34]:
weather.season_desc[335:] = 'Winter'
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [35]:
weather
Out[35]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
1
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
1
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
1
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Winter
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Winter
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [36]:
weather[300:]
Out[36]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
300
2012-10-27
6
4
Fall
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.530000
0.515133
0.720000
0.235692
2643
5209
7852
301
2012-10-28
0
4
Fall
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.477500
0.467771
0.694583
0.398008
998
3461
4459
302
2012-10-29
1
4
Fall
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.440000
0.439400
0.880000
0.358200
2
20
22
303
2012-10-30
2
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.318182
0.309909
0.825455
0.213009
87
1009
1096
304
2012-10-31
3
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.357500
0.361100
0.666667
0.166667
419
5147
5566
305
2012-11-01
4
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.365833
0.369942
0.581667
0.157346
466
5520
5986
306
2012-11-02
5
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.355000
0.356042
0.522083
0.266175
618
5229
5847
307
2012-11-03
6
4
Fall
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.343333
0.323846
0.491250
0.270529
1029
4109
5138
308
2012-11-04
0
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.325833
0.329538
0.532917
0.179108
1201
3906
5107
309
2012-11-05
1
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.319167
0.308075
0.494167
0.236325
378
4881
5259
310
2012-11-06
2
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.280833
0.281567
0.567083
0.173513
466
5220
5686
311
2012-11-07
3
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.295833
0.274621
0.547500
0.304108
326
4709
5035
312
2012-11-08
4
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.352174
0.341891
0.333478
0.347835
340
4975
5315
313
2012-11-09
5
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.361667
0.355413
0.540833
0.214558
709
5283
5992
314
2012-11-10
6
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.389167
0.393937
0.645417
0.057846
2090
4446
6536
315
2012-11-11
0
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.420833
0.421713
0.659167
0.127500
2290
4562
6852
316
2012-11-12
1
4
Fall
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.485000
0.475383
0.741667
0.173517
1097
5172
6269
317
2012-11-13
2
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.343333
0.323225
0.662917
0.342046
327
3767
4094
318
2012-11-14
3
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.289167
0.281563
0.552083
0.199625
373
5122
5495
319
2012-11-15
4
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.321667
0.324492
0.620417
0.152987
320
5125
5445
320
2012-11-16
5
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.345000
0.347204
0.524583
0.171025
484
5214
5698
321
2012-11-17
6
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.325000
0.326383
0.545417
0.179729
1313
4316
5629
322
2012-11-18
0
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.337746
0.692917
0.227612
922
3747
4669
323
2012-11-19
1
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.380833
0.375621
0.623333
0.235067
449
5050
5499
324
2012-11-20
2
4
Fall
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.374167
0.380667
0.685000
0.082725
534
5100
5634
325
2012-11-21
3
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.353333
0.364892
0.613750
0.103246
615
4531
5146
326
2012-11-22
4
4
Fall
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.340000
0.350371
0.580417
0.052871
955
1470
2425
327
2012-11-23
5
4
Fall
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.368333
0.378779
0.568750
0.148021
1603
2307
3910
328
2012-11-24
6
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.278333
0.248742
0.404583
0.376871
532
1745
2277
329
2012-11-25
0
4
Fall
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.257583
0.468333
0.150500
309
2115
2424
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
1
Winter
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
1
Winter
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
1
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
1
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
1
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
66 rows × 15 columns
In [37]:
weather.season_code[:60] = 4
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [38]:
weather.season_code[60:152] = 1
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [39]:
weather.season_code[152:244] = 2
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [40]:
weather.season_code[244:335] = 3
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [41]:
weather.season_code[335:] = 4
/home/ndraper2/Envs/bikeshare/lib/python2.7/site-packages/IPython/kernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
In [42]:
weather
Out[42]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
2012-01-01
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.692500
0.192167
686
1608
2294
1
2012-01-02
1
4
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.273043
0.252304
0.381304
0.329665
244
1707
1951
2
2012-01-03
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.150000
0.126275
0.441250
0.365671
89
2147
2236
3
2012-01-04
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.107500
0.119337
0.414583
0.184700
95
2273
2368
4
2012-01-05
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.278412
0.524167
0.129987
140
3132
3272
5
2012-01-06
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.334167
0.340267
0.542083
0.167908
307
3791
4098
6
2012-01-07
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.393333
0.390779
0.531667
0.174758
1070
3451
4521
7
2012-01-08
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.337500
0.340258
0.465000
0.191542
599
2826
3425
8
2012-01-09
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.224167
0.247479
0.701667
0.098900
106
2270
2376
9
2012-01-10
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.308696
0.318826
0.646522
0.187552
173
3425
3598
10
2012-01-11
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.274167
0.282821
0.847500
0.131221
92
2085
2177
11
2012-01-12
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.382500
0.381938
0.802917
0.180967
269
3828
4097
12
2012-01-13
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.274167
0.249362
0.507500
0.378108
174
3040
3214
13
2012-01-14
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.180000
0.183087
0.457500
0.187183
333
2160
2493
14
2012-01-15
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.166667
0.161625
0.419167
0.251258
284
2027
2311
15
2012-01-16
1
4
Winter
1
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190663
0.522500
0.231358
217
2081
2298
16
2012-01-17
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.373043
0.364278
0.716087
0.349130
127
2808
2935
17
2012-01-18
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.303333
0.275254
0.443333
0.415429
109
3267
3376
18
2012-01-19
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.190000
0.190038
0.497500
0.220158
130
3162
3292
19
2012-01-20
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.217500
0.220958
0.450000
0.202750
115
3048
3163
20
2012-01-21
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.173333
0.174875
0.831250
0.222642
67
1234
1301
21
2012-01-22
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.162500
0.162250
0.796250
0.199638
196
1781
1977
22
2012-01-23
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.218333
0.243058
0.911250
0.110708
145
2287
2432
23
2012-01-24
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.342500
0.349108
0.835833
0.123767
439
3900
4339
24
2012-01-25
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.294167
0.294821
0.643750
0.161071
467
3803
4270
25
2012-01-26
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.341667
0.356050
0.769583
0.073396
244
3831
4075
26
2012-01-27
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425000
0.415383
0.741250
0.342667
269
3187
3456
27
2012-01-28
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.315833
0.326379
0.543333
0.210829
775
3248
4023
28
2012-01-29
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.282500
0.272721
0.311250
0.240050
558
2685
3243
29
2012-01-30
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.269167
0.262625
0.400833
0.215792
126
3498
3624
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
336
2012-12-02
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.347500
0.359208
0.823333
0.124379
892
3757
4649
337
2012-12-03
1
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.452500
0.455796
0.767500
0.082721
555
5679
6234
338
2012-12-04
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.475833
0.469054
0.733750
0.174129
551
6055
6606
339
2012-12-05
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.438333
0.428012
0.485000
0.324021
331
5398
5729
340
2012-12-06
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.258204
0.508750
0.174754
340
5035
5375
341
2012-12-07
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.320833
0.321958
0.764167
0.130600
349
4659
5008
342
2012-12-08
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.381667
0.389508
0.911250
0.101379
1153
4429
5582
343
2012-12-09
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.384167
0.390146
0.905417
0.157975
441
2787
3228
344
2012-12-10
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.435833
0.435575
0.925000
0.190308
329
4841
5170
345
2012-12-11
2
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.353333
0.338363
0.596667
0.296037
282
5219
5501
346
2012-12-12
3
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.297500
0.297338
0.538333
0.162937
310
5009
5319
347
2012-12-13
4
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.295833
0.294188
0.485833
0.174129
425
5107
5532
348
2012-12-14
5
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.281667
0.294192
0.642917
0.131229
429
5182
5611
349
2012-12-15
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.324167
0.338383
0.650417
0.106350
767
4280
5047
350
2012-12-16
0
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.362500
0.369938
0.838750
0.100742
538
3248
3786
351
2012-12-17
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.393333
0.401500
0.907083
0.098258
212
4373
4585
352
2012-12-18
2
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.410833
0.409708
0.666250
0.221404
433
5124
5557
353
2012-12-19
3
4
Winter
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.332500
0.342162
0.625417
0.184092
333
4934
5267
354
2012-12-20
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.330000
0.335217
0.667917
0.132463
314
3814
4128
355
2012-12-21
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.326667
0.301767
0.556667
0.374383
221
3402
3623
356
2012-12-22
6
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.265833
0.236113
0.441250
0.407346
205
1544
1749
357
2012-12-23
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.245833
0.259471
0.515417
0.133083
408
1379
1787
358
2012-12-24
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.231304
0.258900
0.791304
0.077230
174
746
920
359
2012-12-25
2
4
Winter
1
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.291304
0.294465
0.734783
0.168726
440
573
1013
360
2012-12-26
3
4
Winter
0
1
3
Light Snow, Light Rain + Thunderstorm + Scatte...
0.243333
0.220333
0.823333
0.316546
9
432
441
361
2012-12-27
4
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.254167
0.226642
0.652917
0.350133
247
1867
2114
362
2012-12-28
5
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.255046
0.590000
0.155471
644
2451
3095
363
2012-12-29
6
4
Winter
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.253333
0.242400
0.752917
0.124383
159
1182
1341
364
2012-12-30
0
4
Winter
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.255833
0.231700
0.483333
0.350754
364
1432
1796
365
2012-12-31
1
4
Winter
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.577500
0.154846
439
2290
2729
366 rows × 15 columns
In [43]:
weather[80:105]
Out[43]:
date
weekday
season_code
season_desc
is_holiday
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
80
2012-03-21
3
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.531667
0.513258
0.821250
0.089558
1122
5108
6230
81
2012-03-22
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.554167
0.531567
0.831250
0.117562
1334
5537
6871
82
2012-03-23
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.601667
0.570067
0.694167
0.116300
2469
5893
8362
83
2012-03-24
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.502500
0.486733
0.885417
0.192783
1033
2339
3372
84
2012-03-25
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.437500
0.437488
0.880833
0.220775
1532
3464
4996
85
2012-03-26
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.445833
0.438750
0.477917
0.386821
795
4763
5558
86
2012-03-27
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.323333
0.315654
0.290000
0.187192
531
4571
5102
87
2012-03-28
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.484167
0.470950
0.481250
0.291671
674
5024
5698
88
2012-03-29
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.494167
0.482304
0.439167
0.319650
834
5299
6133
89
2012-03-30
5
1
Spring
0
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.370000
0.375621
0.580833
0.138067
796
4663
5459
90
2012-03-31
6
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.424167
0.421708
0.738333
0.250617
2301
3934
6235
91
2012-04-01
0
1
Spring
0
0
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.425833
0.417287
0.676250
0.172267
2347
3694
6041
92
2012-04-02
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.433913
0.427513
0.504348
0.312139
1208
4728
5936
93
2012-04-03
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.466667
0.461483
0.396667
0.100133
1348
5424
6772
94
2012-04-04
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.541667
0.533450
0.469583
0.180975
1058
5378
6436
95
2012-04-05
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.435000
0.431163
0.374167
0.219529
1192
5265
6457
96
2012-04-06
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.403333
0.390767
0.377083
0.300388
1807
4653
6460
97
2012-04-07
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.437500
0.426129
0.254167
0.274871
3252
3605
6857
98
2012-04-08
0
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.500000
0.492425
0.275833
0.232596
2230
2939
5169
99
2012-04-09
1
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.489167
0.476638
0.317500
0.358196
905
4680
5585
100
2012-04-10
2
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.446667
0.436233
0.435000
0.249375
819
5099
5918
101
2012-04-11
3
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.348696
0.337274
0.469565
0.295274
482
4380
4862
102
2012-04-12
4
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.397500
0.387604
0.466250
0.290429
663
4746
5409
103
2012-04-13
5
1
Spring
0
1
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.442500
0.431808
0.408333
0.155471
1252
5146
6398
104
2012-04-14
6
1
Spring
0
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.495000
0.487996
0.502917
0.190917
2795
4665
7460
Changed all season codes to be the right season
In [44]:
weather.pivot_table(index='date', columns='season_desc', values='temp')
Out[44]:
season_desc
Fall
Spring
Summer
Winter
date
2012-01-01
NaN
NaN
NaN
0.370000
2012-01-02
NaN
NaN
NaN
0.273043
2012-01-03
NaN
NaN
NaN
0.150000
2012-01-04
NaN
NaN
NaN
0.107500
2012-01-05
NaN
NaN
NaN
0.265833
2012-01-06
NaN
NaN
NaN
0.334167
2012-01-07
NaN
NaN
NaN
0.393333
2012-01-08
NaN
NaN
NaN
0.337500
2012-01-09
NaN
NaN
NaN
0.224167
2012-01-10
NaN
NaN
NaN
0.308696
2012-01-11
NaN
NaN
NaN
0.274167
2012-01-12
NaN
NaN
NaN
0.382500
2012-01-13
NaN
NaN
NaN
0.274167
2012-01-14
NaN
NaN
NaN
0.180000
2012-01-15
NaN
NaN
NaN
0.166667
2012-01-16
NaN
NaN
NaN
0.190000
2012-01-17
NaN
NaN
NaN
0.373043
2012-01-18
NaN
NaN
NaN
0.303333
2012-01-19
NaN
NaN
NaN
0.190000
2012-01-20
NaN
NaN
NaN
0.217500
2012-01-21
NaN
NaN
NaN
0.173333
2012-01-22
NaN
NaN
NaN
0.162500
2012-01-23
NaN
NaN
NaN
0.218333
2012-01-24
NaN
NaN
NaN
0.342500
2012-01-25
NaN
NaN
NaN
0.294167
2012-01-26
NaN
NaN
NaN
0.341667
2012-01-27
NaN
NaN
NaN
0.425000
2012-01-28
NaN
NaN
NaN
0.315833
2012-01-29
NaN
NaN
NaN
0.282500
2012-01-30
NaN
NaN
NaN
0.269167
...
...
...
...
...
2012-12-02
NaN
NaN
NaN
0.347500
2012-12-03
NaN
NaN
NaN
0.452500
2012-12-04
NaN
NaN
NaN
0.475833
2012-12-05
NaN
NaN
NaN
0.438333
2012-12-06
NaN
NaN
NaN
0.255833
2012-12-07
NaN
NaN
NaN
0.320833
2012-12-08
NaN
NaN
NaN
0.381667
2012-12-09
NaN
NaN
NaN
0.384167
2012-12-10
NaN
NaN
NaN
0.435833
2012-12-11
NaN
NaN
NaN
0.353333
2012-12-12
NaN
NaN
NaN
0.297500
2012-12-13
NaN
NaN
NaN
0.295833
2012-12-14
NaN
NaN
NaN
0.281667
2012-12-15
NaN
NaN
NaN
0.324167
2012-12-16
NaN
NaN
NaN
0.362500
2012-12-17
NaN
NaN
NaN
0.393333
2012-12-18
NaN
NaN
NaN
0.410833
2012-12-19
NaN
NaN
NaN
0.332500
2012-12-20
NaN
NaN
NaN
0.330000
2012-12-21
NaN
NaN
NaN
0.326667
2012-12-22
NaN
NaN
NaN
0.265833
2012-12-23
NaN
NaN
NaN
0.245833
2012-12-24
NaN
NaN
NaN
0.231304
2012-12-25
NaN
NaN
NaN
0.291304
2012-12-26
NaN
NaN
NaN
0.243333
2012-12-27
NaN
NaN
NaN
0.254167
2012-12-28
NaN
NaN
NaN
0.253333
2012-12-29
NaN
NaN
NaN
0.253333
2012-12-30
NaN
NaN
NaN
0.255833
2012-12-31
NaN
NaN
NaN
0.215833
366 rows × 4 columns
In [45]:
weather.groupby('season_desc')['temp'].mean
Out[45]:
<bound method SeriesGroupBy.mean of <pandas.core.groupby.SeriesGroupBy object at 0x7f2bc7c56a50>>
In [46]:
weather.groupby('season_desc')['temp'].mean()
Out[46]:
season_desc
Fall 0.485572
Spring 0.510645
Summer 0.713505
Winter 0.304227
Name: temp, dtype: float64
In [47]:
usage = pd.read_table('usage_2012.tsv')
In [48]:
usage['time_start'] = pd.to_datetime(usage['time_start'])
In [49]:
usage['time_end'] = pd.to_datetime(usage['time_end'])
In [50]:
import datetime
In [51]:
st = datetime.datetime(2012, 12, 01, 0, 0)
In [52]:
end = datetime.datetime(2013, 01, 01 ,0 ,0)
In [53]:
type(usage['time_start'][0])
Out[53]:
pandas.tslib.Timestamp
In [54]:
usage[(usage['time_start'] > '2012-12-01 00:00:00') & (usage['time_start'] < '2012-12-31 23:00:00')]
Out[54]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
2288811
W01275
2012-12-01 00:58:00
2012-12-01 01:11:00
13
Lamont & Mt Pleasant NW
7th & T St NW
Subscriber
2288812
W20172
2012-12-01 00:58:00
2012-12-01 01:06:00
8
11th & H St NE
1st & M St NE
Subscriber
2288813
W01366
2012-12-01 00:57:00
2012-12-01 00:59:00
2
Wilson Blvd & Franklin Rd
Clarendon Metro / Wilson Blvd & N Highland St
Subscriber
2288814
W20050
2012-12-01 00:57:00
2012-12-01 01:02:00
5
Crystal City Metro / 18th & Bell St
12th & Army Navy Dr
Subscriber
2288815
W20944
2012-12-01 00:57:00
2012-12-01 01:03:00
6
Columbus Circle / Union Station
11th & H St NE
Subscriber
2288816
W20175
2012-12-01 00:57:00
2012-12-01 01:07:00
10
10th & U St NW
1st & Rhode Island Ave NW
Subscriber
2288817
W00479
2012-12-01 00:56:00
2012-12-01 01:02:00
6
10th & U St NW
14th & R St NW
Subscriber
2288818
W00343
2012-12-01 00:56:00
2012-12-01 01:01:00
5
10th & U St NW
14th & R St NW
Subscriber
2288819
W00872
2012-12-01 00:56:00
2012-12-01 01:02:00
6
14th & V St NW
16th & Harvard St NW
Subscriber
2288820
W20165
2012-12-01 00:56:00
2012-12-01 01:09:00
13
16th & Harvard St NW
1st & Rhode Island Ave NW
Subscriber
2288821
W00318
2012-12-01 00:55:00
2012-12-01 01:06:00
11
Thomas Circle
1st & Rhode Island Ave NW
Subscriber
2288822
W00295
2012-12-01 00:55:00
2012-12-01 01:11:00
16
14th & V St NW
7th & R St NW / Shaw Library
Subscriber
2288823
W00494
2012-12-01 00:54:00
2012-12-01 00:58:00
4
23rd & Crystal Dr
15th & Crystal Dr
Subscriber
2288824
W20958
2012-12-01 00:54:00
2012-12-01 00:58:00
4
14th & R St NW
California St & Florida Ave NW
Subscriber
2288825
W01413
2012-12-01 00:53:00
2012-12-01 01:12:00
19
8th & H St NW
Calvert St & Woodley Pl NW
Subscriber
2288826
W00058
2012-12-01 00:53:00
2012-12-01 01:01:00
8
14th St & Spring Rd NW
Lamont & Mt Pleasant NW
Subscriber
2288827
W00480
2012-12-01 00:53:00
2012-12-01 00:59:00
6
19th & L St NW
17th & Corcoran St NW
Subscriber
2288828
W20954
2012-12-01 00:52:00
2012-12-01 00:57:00
5
10th & U St NW
11th & Kenyon St NW
Subscriber
2288829
W00321
2012-12-01 00:52:00
2012-12-01 00:56:00
4
20th & O St NW / Dupont South
M St & Pennsylvania Ave NW
Subscriber
2288830
W00117
2012-12-01 00:50:00
2012-12-01 00:52:00
2
25th St & Pennsylvania Ave NW
M St & Pennsylvania Ave NW
Subscriber
2288831
W01401
2012-12-01 00:50:00
2012-12-01 01:03:00
13
6th & H St NE
15th St & Massachusetts Ave SE
Subscriber
2288832
W01279
2012-12-01 00:49:00
2012-12-01 01:00:00
11
14th & Rhode Island Ave NW
20th St & Florida Ave NW
Subscriber
2288833
W20952
2012-12-01 00:49:00
2012-12-01 00:53:00
4
Massachusetts Ave & Dupont Circle NW
New Hampshire Ave & T St NW
Subscriber
2288834
W00770
2012-12-01 00:48:00
2012-12-01 00:54:00
6
Clarendon Blvd & N Fillmore St
Arlington Blvd & N Queen St
Subscriber
2288835
W01165
2012-12-01 00:48:00
2012-12-01 01:00:00
12
7th & F St NW / National Portrait Gallery
Bladensburg Rd & Benning Rd NE
Subscriber
2288836
W01179
2012-12-01 00:48:00
2012-12-01 00:52:00
4
Convention Center / 7th & M St NW
7th & T St NW
Subscriber
2288837
W01139
2012-12-01 00:46:00
2012-12-01 00:54:00
8
Lamont & Mt Pleasant NW
Columbia Rd & Belmont St NW
Subscriber
2288838
W20162
2012-12-01 00:46:00
2012-12-01 01:00:00
14
4th & D St NW / Judiciary Square
Eastern Market Metro / Pennsylvania Ave & 7th ...
Subscriber
2288839
W00347
2012-12-01 00:46:00
2012-12-01 01:00:00
14
7th & T St NW
21st St & Pennsylvania Ave NW
Subscriber
2288840
W20034
2012-12-01 00:45:00
2012-12-01 00:51:00
6
16th & Harvard St NW
15th & P St NW
Subscriber
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
123661 rows × 7 columns
In [55]:
usage['time_start']=pd.to_datetime(usage['time_start'], format='%m/%d/%y %I:%M%p')
In [56]:
usage
Out[56]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
0
W01412
2012-01-01 00:04:00
2012-01-01 00:11:00
7
7th & R St NW / Shaw Library
7th & T St NW
Registered
1
W00524
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Casual
2
W00235
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Registered
3
W00864
2012-01-01 00:15:00
2012-01-01 00:23:00
8
14th & V St NW
Park Rd & Holmead Pl NW
Registered
4
W00995
2012-01-01 00:15:00
2012-01-01 00:23:00
8
11th & Kenyon St NW
7th & T St NW
Registered
5
W00466
2012-01-01 00:17:00
2012-01-01 00:23:00
6
Court House Metro / 15th & N Uhle St
Lynn & 19th St North
Registered
6
W00525
2012-01-01 00:18:00
2012-01-01 00:47:00
29
37th & O St NW / Georgetown University
9th & Upshur St NW
Registered
7
W00340
2012-01-01 00:22:00
2012-01-01 00:27:00
5
14th & V St NW
15th & P St NW
Registered
8
W00466
2012-01-01 00:24:00
2012-01-01 00:33:00
9
Lynn & 19th St North
25th St & Pennsylvania Ave NW
Registered
9
W00963
2012-01-01 00:25:00
2012-01-01 00:40:00
15
14th & V St NW
L'Enfant Plaza / 7th & C St SW
Registered
10
W01398
2012-01-01 00:29:00
2012-01-01 00:48:00
19
Tenleytown / Wisconsin Ave & Albemarle St NW
Massachusetts Ave & Dupont Circle NW
Registered
11
W00042
2012-01-01 00:30:00
2012-01-01 00:38:00
8
New York Ave & 15th St NW
21st & I St NW
Registered
12
W00570
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
13
W01463
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
14
W00535
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
15
W00494
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
16
W00466
2012-01-01 00:33:00
2012-01-01 00:41:00
8
25th St & Pennsylvania Ave NW
New York Ave & 15th St NW
Registered
17
W00663
2012-01-01 00:33:00
2012-01-01 00:39:00
6
7th & T St NW
Convention Center / 7th & M St NW
Registered
18
W01052
2012-01-01 00:34:00
2012-01-01 00:42:00
8
14th & Rhode Island Ave NW
14th & V St NW
Registered
19
W00174
2012-01-01 00:36:00
2012-01-01 00:52:00
16
17th & Corcoran St NW
17th & Corcoran St NW
Registered
20
W01298
2012-01-01 00:37:00
2012-01-01 00:41:00
4
17th & Corcoran St NW
Massachusetts Ave & Dupont Circle NW
Registered
21
W01333
2012-01-01 00:39:00
2012-01-01 00:44:00
5
NaN
8th & H St NW
Registered
22
W00697
2012-01-01 00:39:00
2012-01-01 00:42:00
3
Potomac & Pennsylvania Ave SE
Potomac & Pennsylvania Ave SE
Registered
23
W00260
2012-01-01 00:41:00
2012-01-01 00:49:00
8
4th & E St SW
5th & F St NW
Registered
24
W00658
2012-01-01 00:45:00
2012-01-01 00:48:00
3
18th & M St NW
19th St & Pennsylvania Ave NW
Registered
25
W00996
2012-01-01 00:45:00
2012-01-01 00:54:00
9
15th & P St NW
NaN
Registered
26
W00790
2012-01-01 00:46:00
2012-01-01 00:53:00
7
15th & P St NW
NaN
Registered
27
W01213
2012-01-01 00:48:00
2012-01-01 01:04:00
16
Massachusetts Ave & Dupont Circle NW
5th St & Massachusetts Ave NW
Registered
28
W00981
2012-01-01 00:49:00
2012-01-01 00:55:00
6
Park Rd & Holmead Pl NW
Columbia Rd & Belmont St NW
Registered
29
W01270
2012-01-01 00:49:00
2012-01-01 00:59:00
10
17th & Corcoran St NW
16th & Harvard St NW
Registered
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
2412524 rows × 7 columns
In [58]:
usage.set_index('time_start').groupby(pd.TimeGrouper('M')).size()
Out[58]:
time_start
2012-01-31 193180
2012-02-29 205958
2012-03-31 329308
2012-04-30 173954
2012-05-31 195638
2012-06-30 202600
2012-07-31 203607
2012-08-31 214503
2012-09-30 218573
2012-10-31 198841
2012-11-30 152649
2012-12-31 123713
Freq: M, dtype: int64
In [59]:
usage.set_index('time_start').groupby(pd.TimeGrouper('3M')).size()
Out[59]:
time_start
2012-01-31 193180
2012-04-30 709220
2012-07-31 601845
2012-10-31 631917
2013-01-31 276362
Freq: 3M, dtype: int64
In [60]:
usage['time_start'].dt.date
Out[60]:
0 2012-01-01
1 2012-01-01
2 2012-01-01
3 2012-01-01
4 2012-01-01
5 2012-01-01
6 2012-01-01
7 2012-01-01
8 2012-01-01
9 2012-01-01
10 2012-01-01
11 2012-01-01
12 2012-01-01
13 2012-01-01
14 2012-01-01
15 2012-01-01
16 2012-01-01
17 2012-01-01
18 2012-01-01
19 2012-01-01
20 2012-01-01
21 2012-01-01
22 2012-01-01
23 2012-01-01
24 2012-01-01
25 2012-01-01
26 2012-01-01
27 2012-01-01
28 2012-01-01
29 2012-01-01
...
2412494 2012-12-31
2412495 2012-12-31
2412496 2012-12-31
2412497 2012-12-31
2412498 2012-12-31
2412499 2012-12-31
2412500 2012-12-31
2412501 2012-12-31
2412502 2012-12-31
2412503 2012-12-31
2412504 2012-12-31
2412505 2012-12-31
2412506 2012-12-31
2412507 2012-12-31
2412508 2012-12-31
2412509 2012-12-31
2412510 2012-12-31
2412511 2012-12-31
2412512 2012-12-31
2412513 2012-12-31
2412514 2012-12-31
2412515 2012-12-31
2412516 2012-12-31
2412517 2012-12-31
2412518 2012-12-31
2412519 2012-12-31
2412520 2012-12-31
2412521 2012-12-31
2412522 2012-12-31
2412523 2012-12-31
dtype: object
In [61]:
usage
Out[61]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
0
W01412
2012-01-01 00:04:00
2012-01-01 00:11:00
7
7th & R St NW / Shaw Library
7th & T St NW
Registered
1
W00524
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Casual
2
W00235
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Registered
3
W00864
2012-01-01 00:15:00
2012-01-01 00:23:00
8
14th & V St NW
Park Rd & Holmead Pl NW
Registered
4
W00995
2012-01-01 00:15:00
2012-01-01 00:23:00
8
11th & Kenyon St NW
7th & T St NW
Registered
5
W00466
2012-01-01 00:17:00
2012-01-01 00:23:00
6
Court House Metro / 15th & N Uhle St
Lynn & 19th St North
Registered
6
W00525
2012-01-01 00:18:00
2012-01-01 00:47:00
29
37th & O St NW / Georgetown University
9th & Upshur St NW
Registered
7
W00340
2012-01-01 00:22:00
2012-01-01 00:27:00
5
14th & V St NW
15th & P St NW
Registered
8
W00466
2012-01-01 00:24:00
2012-01-01 00:33:00
9
Lynn & 19th St North
25th St & Pennsylvania Ave NW
Registered
9
W00963
2012-01-01 00:25:00
2012-01-01 00:40:00
15
14th & V St NW
L'Enfant Plaza / 7th & C St SW
Registered
10
W01398
2012-01-01 00:29:00
2012-01-01 00:48:00
19
Tenleytown / Wisconsin Ave & Albemarle St NW
Massachusetts Ave & Dupont Circle NW
Registered
11
W00042
2012-01-01 00:30:00
2012-01-01 00:38:00
8
New York Ave & 15th St NW
21st & I St NW
Registered
12
W00570
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
13
W01463
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
14
W00535
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
15
W00494
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
16
W00466
2012-01-01 00:33:00
2012-01-01 00:41:00
8
25th St & Pennsylvania Ave NW
New York Ave & 15th St NW
Registered
17
W00663
2012-01-01 00:33:00
2012-01-01 00:39:00
6
7th & T St NW
Convention Center / 7th & M St NW
Registered
18
W01052
2012-01-01 00:34:00
2012-01-01 00:42:00
8
14th & Rhode Island Ave NW
14th & V St NW
Registered
19
W00174
2012-01-01 00:36:00
2012-01-01 00:52:00
16
17th & Corcoran St NW
17th & Corcoran St NW
Registered
20
W01298
2012-01-01 00:37:00
2012-01-01 00:41:00
4
17th & Corcoran St NW
Massachusetts Ave & Dupont Circle NW
Registered
21
W01333
2012-01-01 00:39:00
2012-01-01 00:44:00
5
NaN
8th & H St NW
Registered
22
W00697
2012-01-01 00:39:00
2012-01-01 00:42:00
3
Potomac & Pennsylvania Ave SE
Potomac & Pennsylvania Ave SE
Registered
23
W00260
2012-01-01 00:41:00
2012-01-01 00:49:00
8
4th & E St SW
5th & F St NW
Registered
24
W00658
2012-01-01 00:45:00
2012-01-01 00:48:00
3
18th & M St NW
19th St & Pennsylvania Ave NW
Registered
25
W00996
2012-01-01 00:45:00
2012-01-01 00:54:00
9
15th & P St NW
NaN
Registered
26
W00790
2012-01-01 00:46:00
2012-01-01 00:53:00
7
15th & P St NW
NaN
Registered
27
W01213
2012-01-01 00:48:00
2012-01-01 01:04:00
16
Massachusetts Ave & Dupont Circle NW
5th St & Massachusetts Ave NW
Registered
28
W00981
2012-01-01 00:49:00
2012-01-01 00:55:00
6
Park Rd & Holmead Pl NW
Columbia Rd & Belmont St NW
Registered
29
W01270
2012-01-01 00:49:00
2012-01-01 00:59:00
10
17th & Corcoran St NW
16th & Harvard St NW
Registered
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
2412524 rows × 7 columns
In [62]:
usage['date'] = usage['time_start'].dt.date
In [63]:
usage
Out[63]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
date
0
W01412
2012-01-01 00:04:00
2012-01-01 00:11:00
7
7th & R St NW / Shaw Library
7th & T St NW
Registered
2012-01-01
1
W00524
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Casual
2012-01-01
2
W00235
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Registered
2012-01-01
3
W00864
2012-01-01 00:15:00
2012-01-01 00:23:00
8
14th & V St NW
Park Rd & Holmead Pl NW
Registered
2012-01-01
4
W00995
2012-01-01 00:15:00
2012-01-01 00:23:00
8
11th & Kenyon St NW
7th & T St NW
Registered
2012-01-01
5
W00466
2012-01-01 00:17:00
2012-01-01 00:23:00
6
Court House Metro / 15th & N Uhle St
Lynn & 19th St North
Registered
2012-01-01
6
W00525
2012-01-01 00:18:00
2012-01-01 00:47:00
29
37th & O St NW / Georgetown University
9th & Upshur St NW
Registered
2012-01-01
7
W00340
2012-01-01 00:22:00
2012-01-01 00:27:00
5
14th & V St NW
15th & P St NW
Registered
2012-01-01
8
W00466
2012-01-01 00:24:00
2012-01-01 00:33:00
9
Lynn & 19th St North
25th St & Pennsylvania Ave NW
Registered
2012-01-01
9
W00963
2012-01-01 00:25:00
2012-01-01 00:40:00
15
14th & V St NW
L'Enfant Plaza / 7th & C St SW
Registered
2012-01-01
10
W01398
2012-01-01 00:29:00
2012-01-01 00:48:00
19
Tenleytown / Wisconsin Ave & Albemarle St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
11
W00042
2012-01-01 00:30:00
2012-01-01 00:38:00
8
New York Ave & 15th St NW
21st & I St NW
Registered
2012-01-01
12
W00570
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
13
W01463
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
14
W00535
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
15
W00494
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
16
W00466
2012-01-01 00:33:00
2012-01-01 00:41:00
8
25th St & Pennsylvania Ave NW
New York Ave & 15th St NW
Registered
2012-01-01
17
W00663
2012-01-01 00:33:00
2012-01-01 00:39:00
6
7th & T St NW
Convention Center / 7th & M St NW
Registered
2012-01-01
18
W01052
2012-01-01 00:34:00
2012-01-01 00:42:00
8
14th & Rhode Island Ave NW
14th & V St NW
Registered
2012-01-01
19
W00174
2012-01-01 00:36:00
2012-01-01 00:52:00
16
17th & Corcoran St NW
17th & Corcoran St NW
Registered
2012-01-01
20
W01298
2012-01-01 00:37:00
2012-01-01 00:41:00
4
17th & Corcoran St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
21
W01333
2012-01-01 00:39:00
2012-01-01 00:44:00
5
NaN
8th & H St NW
Registered
2012-01-01
22
W00697
2012-01-01 00:39:00
2012-01-01 00:42:00
3
Potomac & Pennsylvania Ave SE
Potomac & Pennsylvania Ave SE
Registered
2012-01-01
23
W00260
2012-01-01 00:41:00
2012-01-01 00:49:00
8
4th & E St SW
5th & F St NW
Registered
2012-01-01
24
W00658
2012-01-01 00:45:00
2012-01-01 00:48:00
3
18th & M St NW
19th St & Pennsylvania Ave NW
Registered
2012-01-01
25
W00996
2012-01-01 00:45:00
2012-01-01 00:54:00
9
15th & P St NW
NaN
Registered
2012-01-01
26
W00790
2012-01-01 00:46:00
2012-01-01 00:53:00
7
15th & P St NW
NaN
Registered
2012-01-01
27
W01213
2012-01-01 00:48:00
2012-01-01 01:04:00
16
Massachusetts Ave & Dupont Circle NW
5th St & Massachusetts Ave NW
Registered
2012-01-01
28
W00981
2012-01-01 00:49:00
2012-01-01 00:55:00
6
Park Rd & Holmead Pl NW
Columbia Rd & Belmont St NW
Registered
2012-01-01
29
W01270
2012-01-01 00:49:00
2012-01-01 00:59:00
10
17th & Corcoran St NW
16th & Harvard St NW
Registered
2012-01-01
...
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2012-12-31
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2012-12-31
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2012-12-31
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2012-12-31
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2012-12-31
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2012-12-31
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2012-12-31
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2012-12-31
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2012-12-31
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2012-12-31
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2012-12-31
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2012-12-31
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2012-12-31
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2012-12-31
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2012-12-31
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2012-12-31
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2012-12-31
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2012-12-31
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2012-12-31
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2012-12-31
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2012-12-31
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2012-12-31
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2012-12-31
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2012-12-31
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
2012-12-31
2412524 rows × 8 columns
In [64]:
weather['date'] = weather['date'].dt.date
In [65]:
type(weather['date'][0])
Out[65]:
datetime.date
In [66]:
uw = pd.merge(usage, weather, left_on='date', right_on='date', how='outer')
In [67]:
uw
Out[67]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
date
weekday
season_code
...
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
W01412
2012-01-01 00:04:00
2012-01-01 00:11:00
7
7th & R St NW / Shaw Library
7th & T St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
1
W00524
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Casual
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
2
W00235
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
3
W00864
2012-01-01 00:15:00
2012-01-01 00:23:00
8
14th & V St NW
Park Rd & Holmead Pl NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
4
W00995
2012-01-01 00:15:00
2012-01-01 00:23:00
8
11th & Kenyon St NW
7th & T St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
5
W00466
2012-01-01 00:17:00
2012-01-01 00:23:00
6
Court House Metro / 15th & N Uhle St
Lynn & 19th St North
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
6
W00525
2012-01-01 00:18:00
2012-01-01 00:47:00
29
37th & O St NW / Georgetown University
9th & Upshur St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
7
W00340
2012-01-01 00:22:00
2012-01-01 00:27:00
5
14th & V St NW
15th & P St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
8
W00466
2012-01-01 00:24:00
2012-01-01 00:33:00
9
Lynn & 19th St North
25th St & Pennsylvania Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
9
W00963
2012-01-01 00:25:00
2012-01-01 00:40:00
15
14th & V St NW
L'Enfant Plaza / 7th & C St SW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
10
W01398
2012-01-01 00:29:00
2012-01-01 00:48:00
19
Tenleytown / Wisconsin Ave & Albemarle St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
11
W00042
2012-01-01 00:30:00
2012-01-01 00:38:00
8
New York Ave & 15th St NW
21st & I St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
12
W00570
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
13
W01463
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
14
W00535
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
15
W00494
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
16
W00466
2012-01-01 00:33:00
2012-01-01 00:41:00
8
25th St & Pennsylvania Ave NW
New York Ave & 15th St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
17
W00663
2012-01-01 00:33:00
2012-01-01 00:39:00
6
7th & T St NW
Convention Center / 7th & M St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
18
W01052
2012-01-01 00:34:00
2012-01-01 00:42:00
8
14th & Rhode Island Ave NW
14th & V St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
19
W00174
2012-01-01 00:36:00
2012-01-01 00:52:00
16
17th & Corcoran St NW
17th & Corcoran St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
20
W01298
2012-01-01 00:37:00
2012-01-01 00:41:00
4
17th & Corcoran St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
21
W01333
2012-01-01 00:39:00
2012-01-01 00:44:00
5
NaN
8th & H St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
22
W00697
2012-01-01 00:39:00
2012-01-01 00:42:00
3
Potomac & Pennsylvania Ave SE
Potomac & Pennsylvania Ave SE
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
23
W00260
2012-01-01 00:41:00
2012-01-01 00:49:00
8
4th & E St SW
5th & F St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
24
W00658
2012-01-01 00:45:00
2012-01-01 00:48:00
3
18th & M St NW
19th St & Pennsylvania Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
25
W00996
2012-01-01 00:45:00
2012-01-01 00:54:00
9
15th & P St NW
NaN
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
26
W00790
2012-01-01 00:46:00
2012-01-01 00:53:00
7
15th & P St NW
NaN
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
27
W01213
2012-01-01 00:48:00
2012-01-01 01:04:00
16
Massachusetts Ave & Dupont Circle NW
5th St & Massachusetts Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
28
W00981
2012-01-01 00:49:00
2012-01-01 00:55:00
6
Park Rd & Holmead Pl NW
Columbia Rd & Belmont St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
29
W01270
2012-01-01 00:49:00
2012-01-01 00:59:00
10
17th & Corcoran St NW
16th & Harvard St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412524 rows × 22 columns
merged the two tables on date
In [68]:
uw.set_index('time_start').groupby(pd.TimeGrouper('M')).size()
Out[68]:
time_start
2012-01-31 193180
2012-02-29 205958
2012-03-31 329308
2012-04-30 173954
2012-05-31 195638
2012-06-30 202600
2012-07-31 203607
2012-08-31 214503
2012-09-30 218573
2012-10-31 198841
2012-11-30 152649
2012-12-31 123713
Freq: M, dtype: int64
In [69]:
import numpy as np
In [70]:
weather_rides = uw.pivot_table(index='date', columns='bike_id', values='temp', aggfunc=np.mean, fill_value=0)
In [71]:
weather_rides
Out[71]:
bike_id
W00005
W00006
W00007
W00008
W00009
W00010
W00011
W00012
W00013
W00014
...
W20982
w00059
w00223
w00461
w00527
w00583
w00644
w00765
w01100
w01117
date
2012-01-01
0.370000
0.000000
0.370000
0.370000
0.000000
0.000000
0.000000
0.370000
0.000000
0.000000
...
0.000000
0.000000
0.000000
0.000000
0.370000
0.370000
0.000000
0.370000
0.370000
0.000000
2012-01-02
0.000000
0.000000
0.273043
0.273043
0.273043
0.000000
0.000000
0.273043
0.000000
0.000000
...
0.000000
0.000000
0.000000
0.000000
0.273043
0.000000
0.000000
0.000000
0.000000
0.000000
2012-01-03
0.000000
0.150000
0.000000
0.000000
0.150000
0.000000
0.000000
0.150000
0.000000
0.000000
...
0.000000
0.000000
0.000000
0.000000
0.150000
0.150000
0.000000
0.150000
0.150000
0.000000
2012-01-04
0.000000
0.000000
0.000000
0.107500
0.107500
0.000000
0.000000
0.107500
0.107500
0.000000
...
0.000000
0.000000
0.000000
0.000000
0.000000
0.107500
0.000000
0.107500
0.107500
0.000000
2012-01-05
0.000000
0.265833
0.265833
0.000000
0.000000
0.000000
0.265833
0.265833
0.265833
0.000000
...
0.000000
0.265833
0.000000
0.000000
0.265833
0.265833
0.000000
0.265833
0.265833
0.000000
2012-01-06
0.334167
0.334167
0.334167
0.334167
0.334167
0.000000
0.334167
0.334167
0.334167
0.000000
...
0.000000
0.000000
0.334167
0.000000
0.334167
0.334167
0.000000
0.334167
0.334167
0.000000
2012-01-07
0.393333
0.393333
0.000000
0.393333
0.393333
0.000000
0.393333
0.393333
0.393333
0.000000
...
0.000000
0.393333
0.393333
0.000000
0.393333
0.393333
0.000000
0.393333
0.393333
0.393333
2012-01-08
0.337500
0.337500
0.000000
0.337500
0.000000
0.000000
0.337500
0.337500
0.337500
0.000000
...
0.000000
0.337500
0.337500
0.000000
0.337500
0.000000
0.000000
0.337500
0.337500
0.337500
2012-01-09
0.224167
0.224167
0.224167
0.224167
0.224167
0.000000
0.224167
0.224167
0.000000
0.000000
...
0.000000
0.000000
0.224167
0.000000
0.224167
0.224167
0.000000
0.224167
0.224167
0.224167
2012-01-10
0.308696
0.308696
0.000000
0.000000
0.308696
0.000000
0.308696
0.308696
0.000000
0.000000
...
0.000000
0.308696
0.000000
0.000000
0.308696
0.308696
0.000000
0.308696
0.308696
0.308696
2012-01-11
0.274167
0.274167
0.000000
0.274167
0.274167
0.000000
0.274167
0.274167
0.274167
0.000000
...
0.000000
0.274167
0.000000
0.000000
0.000000
0.000000
0.000000
0.274167
0.274167
0.274167
2012-01-12
0.382500
0.000000
0.000000
0.382500
0.382500
0.000000
0.382500
0.382500
0.382500
0.000000
...
0.000000
0.382500
0.382500
0.000000
0.382500
0.000000
0.000000
0.382500
0.382500
0.382500
2012-01-13
0.274167
0.274167
0.000000
0.274167
0.274167
0.000000
0.274167
0.274167
0.274167
0.000000
...
0.000000
0.274167
0.000000
0.000000
0.000000
0.000000
0.000000
0.274167
0.000000
0.274167
2012-01-14
0.000000
0.180000
0.000000
0.000000
0.180000
0.000000
0.000000
0.180000
0.180000
0.000000
...
0.000000
0.180000
0.180000
0.000000
0.000000
0.000000
0.000000
0.180000
0.180000
0.000000
2012-01-15
0.000000
0.000000
0.000000
0.000000
0.166667
0.000000
0.000000
0.166667
0.000000
0.000000
...
0.000000
0.166667
0.166667
0.000000
0.000000
0.000000
0.000000
0.166667
0.166667
0.000000
2012-01-16
0.000000
0.000000
0.000000
0.190000
0.190000
0.000000
0.190000
0.190000
0.000000
0.000000
...
0.000000
0.000000
0.190000
0.000000
0.000000
0.190000
0.000000
0.190000
0.190000
0.000000
2012-01-17
0.000000
0.373043
0.000000
0.000000
0.373043
0.000000
0.373043
0.373043
0.000000
0.000000
...
0.000000
0.000000
0.373043
0.000000
0.000000
0.000000
0.000000
0.373043
0.373043
0.373043
2012-01-18
0.000000
0.303333
0.000000
0.303333
0.303333
0.000000
0.303333
0.303333
0.303333
0.000000
...
0.000000
0.303333
0.303333
0.000000
0.303333
0.303333
0.000000
0.303333
0.303333
0.303333
2012-01-19
0.000000
0.190000
0.000000
0.190000
0.190000
0.000000
0.190000
0.190000
0.190000
0.000000
...
0.000000
0.190000
0.190000
0.000000
0.190000
0.190000
0.000000
0.190000
0.190000
0.190000
2012-01-20
0.000000
0.217500
0.000000
0.000000
0.217500
0.000000
0.217500
0.000000
0.217500
0.000000
...
0.000000
0.217500
0.217500
0.000000
0.217500
0.000000
0.000000
0.217500
0.217500
0.217500
2012-01-21
0.000000
0.173333
0.000000
0.000000
0.173333
0.000000
0.000000
0.000000
0.000000
0.000000
...
0.000000
0.173333
0.000000
0.000000
0.173333
0.000000
0.000000
0.173333
0.173333
0.173333
2012-01-22
0.000000
0.162500
0.000000
0.000000
0.162500
0.000000
0.000000
0.162500
0.000000
0.000000
...
0.000000
0.162500
0.162500
0.000000
0.162500
0.000000
0.000000
0.162500
0.162500
0.162500
2012-01-23
0.218333
0.218333
0.000000
0.218333
0.218333
0.000000
0.000000
0.000000
0.218333
0.000000
...
0.000000
0.000000
0.218333
0.000000
0.218333
0.000000
0.000000
0.218333
0.000000
0.218333
2012-01-24
0.342500
0.342500
0.000000
0.342500
0.342500
0.000000
0.000000
0.000000
0.342500
0.000000
...
0.000000
0.342500
0.342500
0.000000
0.342500
0.000000
0.000000
0.342500
0.342500
0.342500
2012-01-25
0.294167
0.294167
0.000000
0.000000
0.294167
0.000000
0.294167
0.000000
0.294167
0.000000
...
0.000000
0.294167
0.294167
0.000000
0.294167
0.000000
0.000000
0.294167
0.294167
0.294167
2012-01-26
0.341667
0.341667
0.000000
0.000000
0.341667
0.000000
0.341667
0.000000
0.341667
0.000000
...
0.000000
0.341667
0.341667
0.000000
0.341667
0.341667
0.000000
0.341667
0.341667
0.341667
2012-01-27
0.425000
0.425000
0.000000
0.000000
0.000000
0.000000
0.425000
0.000000
0.425000
0.000000
...
0.000000
0.425000
0.425000
0.000000
0.425000
0.425000
0.000000
0.000000
0.000000
0.425000
2012-01-28
0.315833
0.315833
0.000000
0.315833
0.315833
0.000000
0.315833
0.000000
0.315833
0.000000
...
0.000000
0.315833
0.000000
0.000000
0.000000
0.315833
0.000000
0.315833
0.315833
0.315833
2012-01-29
0.282500
0.282500
0.000000
0.282500
0.282500
0.000000
0.282500
0.000000
0.282500
0.000000
...
0.000000
0.282500
0.282500
0.000000
0.282500
0.282500
0.000000
0.282500
0.282500
0.282500
2012-01-30
0.269167
0.269167
0.000000
0.269167
0.269167
0.000000
0.269167
0.000000
0.269167
0.000000
...
0.000000
0.269167
0.000000
0.000000
0.269167
0.269167
0.000000
0.269167
0.269167
0.000000
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
2012-12-02
0.347500
0.000000
0.347500
0.347500
0.347500
0.347500
0.347500
0.347500
0.000000
0.347500
...
0.347500
0.000000
0.000000
0.347500
0.347500
0.000000
0.000000
0.347500
0.000000
0.347500
2012-12-03
0.452500
0.000000
0.452500
0.452500
0.452500
0.000000
0.452500
0.452500
0.452500
0.452500
...
0.000000
0.452500
0.000000
0.452500
0.452500
0.452500
0.452500
0.452500
0.000000
0.452500
2012-12-04
0.475833
0.000000
0.475833
0.475833
0.475833
0.475833
0.475833
0.475833
0.000000
0.475833
...
0.475833
0.000000
0.475833
0.475833
0.475833
0.475833
0.475833
0.475833
0.000000
0.475833
2012-12-05
0.000000
0.438333
0.438333
0.438333
0.438333
0.000000
0.438333
0.438333
0.000000
0.000000
...
0.438333
0.438333
0.438333
0.438333
0.438333
0.438333
0.438333
0.438333
0.000000
0.000000
2012-12-06
0.255833
0.255833
0.000000
0.255833
0.255833
0.255833
0.000000
0.000000
0.255833
0.255833
...
0.255833
0.000000
0.255833
0.255833
0.255833
0.255833
0.255833
0.255833
0.000000
0.000000
2012-12-07
0.320833
0.320833
0.320833
0.320833
0.320833
0.320833
0.000000
0.320833
0.000000
0.320833
...
0.320833
0.000000
0.320833
0.320833
0.000000
0.320833
0.320833
0.320833
0.000000
0.000000
2012-12-08
0.381667
0.381667
0.381667
0.381667
0.381667
0.381667
0.381667
0.000000
0.000000
0.381667
...
0.381667
0.381667
0.381667
0.381667
0.381667
0.381667
0.381667
0.381667
0.000000
0.000000
2012-12-09
0.384167
0.000000
0.384167
0.384167
0.000000
0.384167
0.000000
0.000000
0.000000
0.384167
...
0.384167
0.384167
0.384167
0.384167
0.384167
0.384167
0.384167
0.384167
0.000000
0.000000
2012-12-10
0.435833
0.435833
0.435833
0.435833
0.000000
0.435833
0.435833
0.435833
0.000000
0.435833
...
0.435833
0.435833
0.000000
0.435833
0.435833
0.435833
0.435833
0.435833
0.000000
0.000000
2012-12-11
0.353333
0.353333
0.353333
0.353333
0.353333
0.353333
0.353333
0.353333
0.000000
0.353333
...
0.353333
0.000000
0.353333
0.353333
0.353333
0.353333
0.353333
0.000000
0.000000
0.000000
2012-12-12
0.297500
0.297500
0.297500
0.297500
0.297500
0.000000
0.297500
0.297500
0.000000
0.297500
...
0.297500
0.000000
0.297500
0.000000
0.297500
0.297500
0.297500
0.000000
0.000000
0.297500
2012-12-13
0.295833
0.000000
0.295833
0.295833
0.295833
0.000000
0.295833
0.295833
0.000000
0.295833
...
0.295833
0.000000
0.295833
0.295833
0.295833
0.295833
0.295833
0.000000
0.000000
0.000000
2012-12-14
0.281667
0.000000
0.281667
0.281667
0.000000
0.281667
0.281667
0.281667
0.000000
0.281667
...
0.000000
0.000000
0.281667
0.281667
0.281667
0.281667
0.281667
0.281667
0.000000
0.281667
2012-12-15
0.324167
0.000000
0.000000
0.324167
0.000000
0.324167
0.324167
0.324167
0.000000
0.324167
...
0.000000
0.000000
0.324167
0.324167
0.324167
0.324167
0.324167
0.324167
0.000000
0.324167
2012-12-16
0.362500
0.000000
0.362500
0.362500
0.362500
0.362500
0.362500
0.362500
0.000000
0.362500
...
0.362500
0.000000
0.000000
0.362500
0.362500
0.362500
0.000000
0.362500
0.000000
0.362500
2012-12-17
0.000000
0.000000
0.000000
0.000000
0.000000
0.393333
0.393333
0.393333
0.000000
0.393333
...
0.393333
0.000000
0.393333
0.393333
0.393333
0.393333
0.393333
0.393333
0.000000
0.393333
2012-12-18
0.410833
0.410833
0.410833
0.410833
0.000000
0.410833
0.000000
0.410833
0.000000
0.000000
...
0.410833
0.000000
0.410833
0.410833
0.410833
0.000000
0.000000
0.000000
0.000000
0.410833
2012-12-19
0.332500
0.332500
0.332500
0.332500
0.000000
0.332500
0.332500
0.332500
0.000000
0.332500
...
0.332500
0.000000
0.000000
0.332500
0.332500
0.332500
0.332500
0.000000
0.000000
0.332500
2012-12-20
0.330000
0.330000
0.330000
0.330000
0.000000
0.330000
0.330000
0.330000
0.000000
0.330000
...
0.330000
0.000000
0.330000
0.330000
0.330000
0.330000
0.330000
0.000000
0.000000
0.330000
2012-12-21
0.326667
0.326667
0.326667
0.326667
0.000000
0.326667
0.000000
0.326667
0.000000
0.326667
...
0.326667
0.000000
0.326667
0.326667
0.326667
0.326667
0.326667
0.326667
0.000000
0.326667
2012-12-22
0.265833
0.265833
0.265833
0.265833
0.000000
0.265833
0.000000
0.000000
0.000000
0.000000
...
0.265833
0.000000
0.265833
0.000000
0.265833
0.265833
0.000000
0.265833
0.000000
0.265833
2012-12-23
0.000000
0.245833
0.245833
0.000000
0.000000
0.245833
0.000000
0.000000
0.000000
0.000000
...
0.245833
0.000000
0.245833
0.245833
0.245833
0.245833
0.245833
0.000000
0.000000
0.245833
2012-12-24
0.000000
0.231304
0.231304
0.000000
0.000000
0.231304
0.000000
0.000000
0.000000
0.231304
...
0.231304
0.000000
0.231304
0.000000
0.231304
0.000000
0.231304
0.000000
0.000000
0.000000
2012-12-25
0.000000
0.291304
0.000000
0.291304
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
...
0.000000
0.000000
0.291304
0.000000
0.291304
0.000000
0.291304
0.000000
0.000000
0.000000
2012-12-26
0.000000
0.243333
0.000000
0.000000
0.000000
0.243333
0.000000
0.000000
0.000000
0.243333
...
0.243333
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
2012-12-27
0.254167
0.254167
0.000000
0.254167
0.000000
0.254167
0.254167
0.254167
0.000000
0.000000
...
0.254167
0.000000
0.000000
0.000000
0.254167
0.254167
0.000000
0.000000
0.000000
0.254167
2012-12-28
0.253333
0.253333
0.253333
0.253333
0.000000
0.000000
0.253333
0.253333
0.000000
0.253333
...
0.253333
0.000000
0.000000
0.253333
0.253333
0.253333
0.000000
0.253333
0.000000
0.253333
2012-12-29
0.000000
0.000000
0.253333
0.253333
0.000000
0.253333
0.000000
0.000000
0.000000
0.253333
...
0.000000
0.000000
0.253333
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.253333
2012-12-30
0.255833
0.255833
0.255833
0.255833
0.000000
0.000000
0.000000
0.255833
0.000000
0.000000
...
0.000000
0.000000
0.255833
0.000000
0.255833
0.000000
0.000000
0.000000
0.000000
0.255833
2012-12-31
0.215833
0.215833
0.000000
0.000000
0.000000
0.215833
0.000000
0.215833
0.000000
0.215833
...
0.215833
0.000000
0.215833
0.000000
0.215833
0.000000
0.215833
0.000000
0.000000
0.215833
366 rows × 1746 columns
In [72]:
size = uw.set_index('time_start').groupby(pd.TimeGrouper('M')).size()
In [73]:
temp = uw.set_index('time_start').groupby(pd.TimeGrouper('M'))['temp'].mean()
In [74]:
temp_size = pd.DataFrame({'temp': temp, 'size': size})
In [75]:
temp_size
Out[75]:
size
temp
time_start
2012-01-31
193180
0.290846
2012-02-29
205958
0.327514
2012-03-31
329308
0.465777
2012-04-30
173954
0.477665
2012-05-31
195638
0.612952
2012-06-30
202600
0.671553
2012-07-31
203607
0.751041
2012-08-31
214503
0.713106
2012-09-30
218573
0.616453
2012-10-31
198841
0.511315
2012-11-30
152649
0.341375
2012-12-31
123713
0.344421
ta da! created a new dataframe from two series
In [76]:
season = uw.groupby('season_desc').size()
In [77]:
season
Out[77]:
season_desc
Fall 570063
Spring 698900
Summer 620710
Winter 522851
dtype: int64
In [78]:
temperature = uw.groupby('season_desc')['temp'].mean()
In [79]:
temperature
Out[79]:
season_desc
Fall 0.506121
Spring 0.509933
Summer 0.711987
Winter 0.317967
Name: temp, dtype: float64
In [80]:
temp_season = pd.DataFrame({'temperature': temperature, 'season': season})
In [81]:
temp_season
Out[81]:
season
temperature
season_desc
Fall
570063
0.506121
Spring
698900
0.509933
Summer
620710
0.711987
Winter
522851
0.317967
In [82]:
uw
Out[82]:
bike_id
time_start
time_end
duration_mins
station_start
station_end
cust_type
date
weekday
season_code
...
is_work_day
weather_code
weather_desc
temp
subjective_temp
humidity
windspeed
no_casual_riders
no_reg_riders
total_riders
0
W01412
2012-01-01 00:04:00
2012-01-01 00:11:00
7
7th & R St NW / Shaw Library
7th & T St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
1
W00524
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Casual
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
2
W00235
2012-01-01 00:10:00
2012-01-01 00:29:00
19
Georgia & New Hampshire Ave NW
16th & Harvard St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
3
W00864
2012-01-01 00:15:00
2012-01-01 00:23:00
8
14th & V St NW
Park Rd & Holmead Pl NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
4
W00995
2012-01-01 00:15:00
2012-01-01 00:23:00
8
11th & Kenyon St NW
7th & T St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
5
W00466
2012-01-01 00:17:00
2012-01-01 00:23:00
6
Court House Metro / 15th & N Uhle St
Lynn & 19th St North
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
6
W00525
2012-01-01 00:18:00
2012-01-01 00:47:00
29
37th & O St NW / Georgetown University
9th & Upshur St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
7
W00340
2012-01-01 00:22:00
2012-01-01 00:27:00
5
14th & V St NW
15th & P St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
8
W00466
2012-01-01 00:24:00
2012-01-01 00:33:00
9
Lynn & 19th St North
25th St & Pennsylvania Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
9
W00963
2012-01-01 00:25:00
2012-01-01 00:40:00
15
14th & V St NW
L'Enfant Plaza / 7th & C St SW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
10
W01398
2012-01-01 00:29:00
2012-01-01 00:48:00
19
Tenleytown / Wisconsin Ave & Albemarle St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
11
W00042
2012-01-01 00:30:00
2012-01-01 00:38:00
8
New York Ave & 15th St NW
21st & I St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
12
W00570
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
13
W01463
2012-01-01 00:32:00
2012-01-01 00:50:00
18
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
14
W00535
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Lamont & Mt Pleasant NW
14th & Rhode Island Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
15
W00494
2012-01-01 00:33:00
2012-01-01 00:50:00
17
Metro Center / 12th & G St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
16
W00466
2012-01-01 00:33:00
2012-01-01 00:41:00
8
25th St & Pennsylvania Ave NW
New York Ave & 15th St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
17
W00663
2012-01-01 00:33:00
2012-01-01 00:39:00
6
7th & T St NW
Convention Center / 7th & M St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
18
W01052
2012-01-01 00:34:00
2012-01-01 00:42:00
8
14th & Rhode Island Ave NW
14th & V St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
19
W00174
2012-01-01 00:36:00
2012-01-01 00:52:00
16
17th & Corcoran St NW
17th & Corcoran St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
20
W01298
2012-01-01 00:37:00
2012-01-01 00:41:00
4
17th & Corcoran St NW
Massachusetts Ave & Dupont Circle NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
21
W01333
2012-01-01 00:39:00
2012-01-01 00:44:00
5
NaN
8th & H St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
22
W00697
2012-01-01 00:39:00
2012-01-01 00:42:00
3
Potomac & Pennsylvania Ave SE
Potomac & Pennsylvania Ave SE
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
23
W00260
2012-01-01 00:41:00
2012-01-01 00:49:00
8
4th & E St SW
5th & F St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
24
W00658
2012-01-01 00:45:00
2012-01-01 00:48:00
3
18th & M St NW
19th St & Pennsylvania Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
25
W00996
2012-01-01 00:45:00
2012-01-01 00:54:00
9
15th & P St NW
NaN
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
26
W00790
2012-01-01 00:46:00
2012-01-01 00:53:00
7
15th & P St NW
NaN
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
27
W01213
2012-01-01 00:48:00
2012-01-01 01:04:00
16
Massachusetts Ave & Dupont Circle NW
5th St & Massachusetts Ave NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
28
W00981
2012-01-01 00:49:00
2012-01-01 00:55:00
6
Park Rd & Holmead Pl NW
Columbia Rd & Belmont St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
29
W01270
2012-01-01 00:49:00
2012-01-01 00:59:00
10
17th & Corcoran St NW
16th & Harvard St NW
Registered
2012-01-01
0
4
...
0
1
Clear, Few clouds, Partly cloudy, Partly cloudy
0.370000
0.375621
0.6925
0.192167
686
1608
2294
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
2412494
W01430
2012-12-31 09:09:00
2012-12-31 09:20:00
11
15th St & Massachusetts Ave SE
North Capitol St & F St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412495
W01486
2012-12-31 09:09:00
2012-12-31 09:28:00
19
Lincoln Park / 13th & East Capitol St NE
17th & Rhode Island Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412496
W00703
2012-12-31 09:08:00
2012-12-31 09:16:00
8
Braddock Rd Metro
Market Square / King St & Royal St
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412497
W00186
2012-12-31 09:08:00
2012-12-31 09:19:00
11
16th & Harvard St NW
24th & N St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412498
W00190
2012-12-31 09:08:00
2012-12-31 09:19:00
11
Columbia Rd & Georgia Ave NW
Calvert St & Woodley Pl NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412499
W20898
2012-12-31 09:08:00
2012-12-31 09:14:00
6
7th & R St NW / Shaw Library
5th & K St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412500
W20903
2012-12-31 09:08:00
2012-12-31 09:18:00
10
17th & Rhode Island Ave NW
10th & E St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412501
W00189
2012-12-31 09:08:00
2012-12-31 09:18:00
10
Adams Mill & Columbia Rd NW
24th & N St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412502
W20946
2012-12-31 09:07:00
2012-12-31 09:17:00
10
7th & F St NW / National Portrait Gallery
21st & I St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412503
W01438
2012-12-31 09:07:00
2012-12-31 09:12:00
5
11th & H St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412504
W00110
2012-12-31 09:07:00
2012-12-31 09:20:00
13
14th & V St NW
1st & M St NE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412505
W00122
2012-12-31 09:06:00
2012-12-31 09:08:00
2
N Quincy St & Wilson Blvd
Central Library / N Quincy St & 10th St N
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412506
W01397
2012-12-31 09:06:00
2012-12-31 09:13:00
7
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412507
W00078
2012-12-31 09:05:00
2012-12-31 09:27:00
22
10th & Monroe St NE
Eastern Market / 7th & North Carolina Ave SE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412508
W00586
2012-12-31 09:05:00
2012-12-31 09:10:00
5
20th St & Florida Ave NW
20th & L St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412509
W01417
2012-12-31 09:05:00
2012-12-31 09:23:00
18
17th & Corcoran St NW
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412510
W00282
2012-12-31 09:05:00
2012-12-31 09:15:00
10
5th & K St NW
13th & H St NE
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412511
W00574
2012-12-31 09:04:00
2012-12-31 09:15:00
11
11th & H St NE
Maryland & Independence Ave SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412512
W00986
2012-12-31 09:04:00
2012-12-31 09:18:00
14
14th & R St NW
18th St & Pennsylvania Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412513
W20079
2012-12-31 09:02:00
2012-12-31 09:10:00
8
Lincoln Park / 13th & East Capitol St NE
Columbus Circle / Union Station
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412514
W01142
2012-12-31 09:02:00
2012-12-31 09:06:00
4
Thomas Circle
17th & K St NW / Farragut Square
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412515
W20888
2012-12-31 09:02:00
2012-12-31 09:06:00
4
27th & Crystal Dr
Crystal City Metro / 18th & Bell St
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412516
W00025
2012-12-31 09:02:00
2012-12-31 09:11:00
9
14th & Rhode Island Ave NW
20th & E St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412517
W01059
2012-12-31 09:01:00
2012-12-31 09:07:00
6
15th & P St NW
17th & K St NW / Farragut Square
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412518
W20913
2012-12-31 09:01:00
2012-12-31 09:12:00
11
13th & D St NE
7th & F St NW / National Portrait Gallery
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412519
W00885
2012-12-31 09:01:00
2012-12-31 09:09:00
8
New Hampshire Ave & T St NW
22nd & I St NW / Foggy Bottom
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412520
W00384
2012-12-31 09:01:00
2012-12-31 09:18:00
17
1st & M St NE
US Dept of State / Virginia Ave & 21st St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412521
W20102
2012-12-31 09:00:00
2012-12-31 09:12:00
12
4th & East Capitol St NE
Smithsonian / Jefferson Dr & 12th St SW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412522
W00746
2012-12-31 09:00:00
2012-12-31 09:11:00
11
21st & M St NW
13th St & New York Ave NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412523
W20982
2012-12-31 09:00:00
2012-12-31 09:09:00
9
16th & Harvard St NW
17th & K St NW
Subscriber
2012-12-31
1
4
...
1
2
Mist + Cloudy, Mist + Broken clouds, Mist + Fe...
0.215833
0.223487
0.5775
0.154846
439
2290
2729
2412524 rows × 22 columns
In [83]:
casual = uw.groupby('no_casual_riders').mean()
In [84]:
casual
Out[84]:
duration_mins
weekday
season_code
is_holiday
is_work_day
weather_code
temp
subjective_temp
humidity
windspeed
no_reg_riders
total_riders
no_casual_riders
2
9.681818
1.000000
3.000000
0
1
3.000000
0.440000
0.439400
0.880000
0.358200
20.000000
22.000000
9
9.217687
3.000000
4.000000
0
1
3.000000
0.243333
0.220333
0.823333
0.316546
432.000000
441.000000
65
10.449426
3.000000
4.000000
0
1
2.000000
0.344348
0.348470
0.804783
0.179117
1769.000000
1834.000000
67
12.840000
6.000000
4.000000
0
0
2.000000
0.173333
0.174875
0.831250
0.222642
1234.000000
1301.000000
73
10.036625
0.000000
4.000000
0
0
1.000000
0.127500
0.101658
0.464583
0.409212
1456.000000
1529.000000
74
11.936333
4.000000
4.000000
0
1
2.000000
0.316667
0.330162
0.752917
0.091425
2931.000000
3005.000000
87
10.829380
2.000000
3.000000
0
1
2.000000
0.318182
0.309909
0.825455
0.213009
1009.000000
1096.000000
89
10.370802
2.000000
4.000000
0
1
1.000000
0.150000
0.126275
0.441250
0.365671
2147.000000
2236.000000
92
11.035879
3.000000
4.000000
0
1
2.000000
0.274167
0.282821
0.847500
0.131221
2085.000000
2177.000000
94
10.836502
1.000000
4.000000
0
1
1.000000
0.222500
0.227913
0.411250
0.167283
3328.000000
3422.000000
95
9.737643
3.000000
4.000000
0
1
2.000000
0.107500
0.119337
0.414583
0.184700
2273.000000
2368.000000
106
10.880169
1.000000
4.000000
0
1
2.000000
0.224167
0.247479
0.701667
0.098900
2270.000000
2376.000000
109
11.192408
3.000000
4.000000
0
1
1.453277
0.282180
0.271250
0.570062
0.287737
3006.818949
3115.818949
115
11.867554
5.000000
4.000000
0
1
2.000000
0.217500
0.220958
0.450000
0.202750
3048.000000
3163.000000
120
12.500489
0.000000
1.000000
0
0
3.000000
0.396667
0.389504
0.835417
0.344546
907.000000
1027.000000
123
10.798687
2.000000
3.000000
0
1
2.000000
0.291667
0.281558
0.786667
0.237562
3836.000000
3959.000000
126
11.715076
1.000000
4.000000
0
1
1.000000
0.269167
0.262625
0.400833
0.215792
3498.000000
3624.000000
127
12.222450
2.000000
4.000000
0
1
2.000000
0.373043
0.364278
0.716087
0.349130
2808.000000
2935.000000
130
11.761948
4.000000
4.000000
0
1
1.000000
0.190000
0.190038
0.497500
0.220158
3162.000000
3292.000000
135
12.912765
2.000000
4.000000
0
1
2.000000
0.319167
0.333946
0.508750
0.141179
3787.000000
3922.000000
140
11.624962
4.000000
4.000000
0
1
1.000000
0.265833
0.278412
0.524167
0.129987
3132.000000
3272.000000
141
11.844231
3.000000
4.000000
0
1
1.000000
0.348333
0.351629
0.531250
0.181600
4028.000000
4169.000000
145
10.892548
1.000000
4.000000
0
1
2.000000
0.218333
0.243058
0.911250
0.110708
2287.000000
2432.000000
159
14.319911
6.000000
4.000000
0
0
2.000000
0.253333
0.242400
0.752917
0.124383
1182.000000
1341.000000
163
12.094668
3.006978
4.000000
0
1
1.000000
0.276333
0.278435
0.578103
0.199836
3640.684924
3803.684924
173
12.787027
2.000000
4.000000
0
1
1.000000
0.308696
0.318826
0.646522
0.187552
3425.000000
3598.000000
174
11.191437
4.498227
4.000000
0
1
1.125443
0.268790
0.250558
0.543101
0.340365
2752.233433
2926.233433
190
10.990943
4.000000
4.000000
0
1
2.000000
0.399167
0.398971
0.672917
0.187187
3571.000000
3761.000000
192
12.009225
6.000000
4.000000
0
0
3.000000
0.224167
0.210867
0.731250
0.289796
1977.000000
2169.000000
195
11.398876
1.000000
1.000000
0
1
2.000000
0.321667
0.301125
0.766667
0.303496
3019.000000
3214.000000
...
...
...
...
...
...
...
...
...
...
...
...
...
2469
25.076039
5.000000
1.000000
0
1
2.000000
0.601667
0.570067
0.694167
0.116300
5893.000000
8362.000000
2494
22.342102
0.000000
2.000000
0
0
1.000000
0.602500
0.575133
0.493333
0.184087
5147.000000
7641.000000
2496
22.988813
6.000000
1.000000
0
0
2.000000
0.621667
0.584608
0.756667
0.152992
4387.000000
6883.000000
2512
23.265873
6.000000
3.000000
0
0
1.000000
0.650000
0.610488
0.646667
0.283583
5883.000000
8395.000000
2541
27.709409
6.000000
1.000000
0
0
1.000000
0.570000
0.542921
0.682917
0.283587
4083.000000
6624.000000
2544
22.452362
0.000000
2.000000
0
0
2.000000
0.667500
0.623125
0.762500
0.093921
4866.000000
7410.000000
2551
22.904485
0.000000
2.000000
0
0
1.000000
0.743333
0.674254
0.479167
0.145525
4340.000000
6891.000000
2557
25.926300
1.000000
1.000000
1
0
1.000000
0.712500
0.679300
0.676250
0.196521
3486.000000
6043.000000
2562
36.266919
3.000000
2.000000
1
0
1.000000
0.789167
0.732337
0.538750
0.134950
4841.000000
7403.000000
2570
21.729671
0.000000
3.000000
0
0
1.000000
0.610000
0.578925
0.547500
0.224496
5657.000000
8227.000000
2589
22.022326
6.000000
3.000000
0
0
1.000000
0.542500
0.530296
0.542917
0.227604
5966.000000
8555.000000
2613
24.705164
0.000000
3.000000
0
0
2.000000
0.696667
0.649000
0.815000
0.064071
3197.000000
5810.000000
2622
25.515551
6.000000
1.000000
0
0
1.000000
0.564167
0.544817
0.480417
0.123133
4807.000000
7429.000000
2634
23.805827
0.000000
2.000000
0
0
1.000000
0.592500
0.571975
0.598750
0.144904
4344.000000
6978.000000
2643
23.636526
6.000000
3.000000
0
0
2.000000
0.530000
0.515133
0.720000
0.235692
5209.000000
7852.000000
2657
23.549114
6.000000
2.000000
0
0
1.000000
0.731667
0.652792
0.534583
0.179721
4801.000000
7458.000000
2704
24.977120
0.000000
1.000000
0
0
1.000000
0.620833
0.583967
0.530417
0.254367
4425.000000
7129.000000
2708
24.777748
6.000000
2.000000
0
0
1.000000
0.710833
0.648367
0.437083
0.144287
4790.000000
7498.000000
2795
27.203454
6.000000
1.521186
0
0
1.000000
0.541038
0.528801
0.527022
0.188647
5008.983051
7803.983051
2806
24.327318
6.000000
3.000000
0
0
1.000000
0.484167
0.472842
0.572917
0.117537
5284.000000
8090.000000
2827
23.875270
6.000000
2.000000
0
0
1.000000
0.678333
0.618071
0.603333
0.177867
5038.000000
7865.000000
2846
28.241718
0.000000
1.000000
0
0
1.000000
0.606667
0.573875
0.507917
0.225129
4286.000000
7132.000000
2855
27.352671
6.000000
1.000000
0
0
1.000000
0.692500
0.642696
0.732500
0.198992
3681.000000
6536.000000
2963
25.402312
6.000000
2.000000
0
0
1.000000
0.631667
0.594708
0.504167
0.166667
4739.000000
7702.000000
3031
25.524545
6.000000
3.000000
0
0
1.000000
0.554167
0.538521
0.664167
0.268025
4934.000000
7965.000000
3155
29.263662
6.000000
1.000000
0
0
2.000000
0.514167
0.505046
0.755833
0.110704
4681.000000
7836.000000
3160
24.745008
6.000000
3.000000
0
0
1.000000
0.608333
0.585867
0.501667
0.247521
5554.000000
8714.000000
3252
28.663166
6.000000
1.000000
0
0
1.000000
0.437500
0.426129
0.254167
0.274871
3605.000000
6857.000000
3283
30.896023
0.000000
1.000000
0
0
1.000000
0.690000
0.641425
0.697083
0.215171
3308.000000
6591.000000
3410
27.660396
6.000000
1.000000
0
0
1.000000
0.600000
0.566908
0.456250
0.083975
4884.000000
8294.000000
332 rows × 12 columns
In [85]:
cust_type = uw.groupby('cust_type').size()
In [86]:
cust_type
Out[86]:
cust_type
Casual 421958
Registered 1584150
Subscriber 406416
dtype: int64
In [89]:
cust_type = uw.pivot_table(index='season_desc', columns='cust_type', values='temp', aggfunc=np.size)
In [90]:
cust_type
Out[90]:
cust_type
Casual
Registered
Subscriber
season_desc
Fall
99320
174795
295948
Spring
145883
553017
NaN
Summer
128176
492534
NaN
Winter
48579
363804
110468
In [ ]:
Content source: meslater1030/bikeshare
Similar notebooks: