<jupyter_start><jupyter_text>The project this week is to find out what would have been the best two weeks of weather for a 2014 vacation in a capital of a BRICS country.So I'll be using China with Beinjing as capital  **The first thing to do is to import important libraries that will give us this objectives** import warningswarnings.simplefilter('ignore', FutureWarning)import pandas as pdfrom datetime import datetime beinjing = pd.read_csv('Beijing_PEK_2014.csv', skipinitialspace=True)beinjing.head() let us begin by seeing all the headings of the columns<jupyter_code>beinjing.columns<jupyter_output><empty_output><jupyter_text>Cleaning the dataFirst we need to clean up the data. I'm not going to make use of 'WindDirDegrees' in my analysis, so we'll rename 'WindDirDegrees' to 'WindDirDegrees'.<jupyter_code>beinjing = beinjing.rename(columns={'WindDirDegrees<br />' : 'WindDirDegrees'})<jupyter_output><empty_output><jupyter_text>**We remove the redundant ('<br ') from the column also**<jupyter_code>beinjing['WindDirDegrees'] = beinjing['WindDirDegrees'].str.rstrip('<br />')<jupyter_output><empty_output><jupyter_text>**We also change the values to float**<jupyter_code>beinjing['WindDirDegrees'] = beinjing['WindDirDegrees'].astype('float64')<jupyter_output><empty_output><jupyter_text>**We need to change the date into the correct format**<jupyter_code>beinjing['Date'] = pd.to_datetime(beinjing['Date'])<jupyter_output><empty_output><jupyter_text>**Let us cross check to be sure all the columns have the correct data type **<jupyter_code>beinjing['Date'] = pd.to_datetime(beinjing['Date'])
beinjing.dtypes<jupyter_output><empty_output><jupyter_text>**We also need to change the index from the default to the `datetime64` values in the `'GMT'` column so that it is easier to pull out rows between particular dates and display more meaningful graphs:**<jupyter_code>beinjing.index = beinjing['Date']<jupyter_output><empty_output><jupyter_text>Finding a summer breakAccording to meteorologists, summer extends for the whole months of ,May 15th to Sept 15th . I'll then use the date.index like this:<jupyter_code>summer = beinjing.loc[datetime(2014,5,15) : datetime(2014,9,15)]<jupyter_output><empty_output><jupyter_text>**We now show only days with temperature above or equals to 25 C**<jupyter_code>summer[summer['Mean TemperatureC'] >= 25]
summer['Mean TemperatureC'].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output><jupyter_text>**Let us now see the plot of temperature together with rainfall during this time period**<jupyter_code>summer[['Mean TemperatureC', 'Precipitationmm']].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output><jupyter_text>**The second half of August throughly gives an august occasion for vacation.Let's zoom in using a graph,to confirm our suspicion**<jupyter_code>august = summer.loc[datetime(2014,8,1) : datetime(2014,8,31)]
august[['Mean TemperatureC', 'Precipitationmm']].plot(grid=True, figsize=(10,5))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11333333333333333, 'fraction_numerical': 0.018666666666666668, 'mean_word_length': 8.64951768488746, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '635429', 'license': 'MIT', 'n_tokens_mistral': 1056, 'n_tokens_neox': 954, 'n_words': 268, 'path': 'Oluchukwu_Okorie WT-21-183/Beinjing,2014.ipynb', 'repo_name': 'ruthwaiharo/Week-5-Assessment', 'size': '3000'}