<jupyter_start><jupyter_text>PROJECT 1  Project : Holiday weatherThere is nothing I like better than taking a holiday. In this project I am going to use the historic weather data from the Weather Underground for Cape Town  to try to predict two good weather weeks to take off as holiday. Of course the weather in the summer of 2016 may be very different to 2014 but it should give some indication of when would be a good time to take a summer break.  Getting the data; I am loading the Cape Town csv data file.<jupyter_code>import warnings
warnings.simplefilter('ignore', FutureWarning)

import pandas as pd

from datetime import datetime 
Cape_Town = pd.read_csv('CapeTown_CPT_2014.csv', skipinitialspace=True)
Cape_Town.head()<jupyter_output><empty_output><jupyter_text>Cleaning the data<jupyter_code>#I would be using the 'WindDirDegrees' in my analysis, I am renaming 'WindDirDegrees< br />' to 'WindDirDegrees'
Cape_Town = Cape_Town.rename(columns={'WindDirDegrees<br />' : 'WindDirDegrees'})

#this code would remove the < br /> html line breaks from the values in the 'WindDirDegrees' column

Cape_Town['WindDirDegrees'] = Cape_Town['WindDirDegrees'].str.rstrip('<br />')


#This code will change the values in the 'WindDirDegrees' column to float64

Cape_Town['WindDirDegrees'] = Cape_Town['WindDirDegrees'].astype('float64') 
# This code will change the values in the 'GMT' column into values of the datetime64 date type
Cape_Town['Date'] = pd.to_datetime(Cape_Town['Date'])
Cape_Town.index = Cape_Town['Date']<jupyter_output><empty_output><jupyter_text>Finding a summer breakAccording to meteorologists, summer extends for the whole months of June, July, and August in the northern hemisphere and the whole months of December, January, and February in the southern hemisphere. Since I'm in the southern hemisphere I'm going to create a dataframe that can speak to the data without neccessarily cutting into 2015 since the data is for 2014 record.using the `datetime` index, I would need to create a complex form of dataframe as follows:<jupyter_code>summer1 = Cape_Town.loc[datetime(2014,12,1) : datetime(2014,12,31)]
summer2 = Cape_Town.loc[datetime(2014,1,1) : datetime(2014,2,28)]
summer = summer2.append(summer1)<jupyter_output><empty_output><jupyter_text>checking for the days with warm temperatures<jupyter_code>summer[summer['Mean TemperatureC'] >= 25]<jupyter_output><empty_output><jupyter_text>Summer 2014 is okay in Cape Town: for all the days the mean temperatures are 25 Celsius or higher.I Would like to visualize this better with a graph.<jupyter_code>%matplotlib inline
summer['Mean TemperatureC'].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output><jupyter_text>looking at the graph,it is clear that all the months in summer looks good for mean temperatures over 20 degrees celcius.<jupyter_code>summer[['Mean TemperatureC', 'Precipitationmm']].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output><jupyter_text>Jan 2014, feb 2014, dec 2014 are good months for vacation there is 0.0 precipitation for the months..<jupyter_code>dec = summer.loc[datetime(2014,12,1) : datetime(2014,12,31)]
dec[['Mean TemperatureC', 'Precipitationmm']].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09076875578882371, 'fraction_numerical': 0.033034887310898424, 'mean_word_length': 6.788461538461538, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '170342', 'license': 'MIT', 'n_tokens_mistral': 1116, 'n_tokens_neox': 963, 'n_words': 349, 'path': 'Funmilayo Aina WT-21-091/Week 5 Assessment/PROJECT_1.ipynb', 'repo_name': 'ruthwaiharo/Week-5-Assessment', 'size': '3239'}