<jupyter_start><jupyter_text>Analyzing Dataframe<jupyter_code>df.head(5)
df.shape
df.index
df.columns
df.dtypes
df['Weather'].unique()
df.nunique()
df.count
df.value_counts()
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 8784 entries, 0 to 8783
Data columns (total 8 columns):
 #   Column            Non-Null Count  Dtype  
---  ------            --------------  -----  
 0   Date/Time         8784 non-null   object 
 1   Temp_C            8784 non-null   float64
 2   Dew Point Temp_C  8784 non-null   float64
 3   Rel Hum_%         8784 non-null   int64  
 4   Wind Speed_km/h   8784 non-null   int64  
 5   Visibility_km     8784 non-null   float64
 6   Press_kPa         8784 non-null   float64
 7   Weather           8784 non-null   object 
dtypes: float64(4), int64(2), object(2)
memory usage: 549.1+ KB<jupyter_text>Finding all the unique Wind Speed values<jupyter_code>df.head()
df.nunique()
df['Wind Speed_km/h'].unique()<jupyter_output><empty_output><jupyter_text>Finding no. of times when Weather is exactly Clear<jupyter_code>df.head()<jupyter_output><empty_output><jupyter_text>Using value_counts()<jupyter_code>df.Weather.value_counts()<jupyter_output><empty_output><jupyter_text>Using Filtering<jupyter_code>df[df['Weather'] == 'Clear']<jupyter_output><empty_output><jupyter_text>Using groupby()<jupyter_code>df.groupby('Weather').get_group('Clear')<jupyter_output><empty_output><jupyter_text>Find the no. of times when Wind Speed is exactly 11 km/hr<jupyter_code>df.head(2)
df[df['Wind Speed_km/h'] == 4]<jupyter_output><empty_output><jupyter_text>Find all Null values in the data<jupyter_code>df.isnull()
df.notnull()
df.isnull().sum()<jupyter_output><empty_output><jupyter_text>Rename Weather to Weather Condition<jupyter_code>df.head()
df.rename(columns = {'Weather' : 'Weather Condition'}, inplace=True)
df.head()<jupyter_output><empty_output><jupyter_text>Mathematical Operations  Mean<jupyter_code>df.Visibility_km.mean()<jupyter_output><empty_output><jupyter_text>Mode<jupyter_code>df['Dew Point Temp_C'].mode()<jupyter_output><empty_output><jupyter_text>Median<jupyter_code>df['Temp_C'].median()<jupyter_output><empty_output><jupyter_text>Standard Deviation<jupyter_code>df.Press_kPa.std()<jupyter_output><empty_output><jupyter_text>Variance<jupyter_code>df['Rel Hum_%'].var()<jupyter_output><empty_output><jupyter_text>Find all instances when snow was recorded  Using value_counts<jupyter_code>df['Weather Condition'].value_counts()<jupyter_output><empty_output><jupyter_text>Using Filtering<jupyter_code>df[df['Weather Condition'] == 'Snow']<jupyter_output><empty_output><jupyter_text>using str.contains<jupyter_code>df[df['Weather Condition'].str.contains('Snow')]<jupyter_output><empty_output><jupyter_text>Find all instance when Wind speed is above 24 and Visibility is 25<jupyter_code>df.head(2)
df[(df['Wind Speed_km/h']> 24) & (df['Visibility_km'] == 25)]<jupyter_output><empty_output><jupyter_text>Mean values of each column against each 'Weather Condition'<jupyter_code>df.groupby('Weather Condition').mean()<jupyter_output><empty_output><jupyter_text>Minimum and Maximum value of each column against each 'Weather Condition'<jupyter_code>df.groupby('Weather Condition').min()
df.groupby('Weather Condition').max()<jupyter_output><empty_output><jupyter_text>all records where Weather Condition is Fog<jupyter_code>df[df['Weather Condition'] == 'Fog']<jupyter_output><empty_output><jupyter_text>all instances when Weather Condition is clear Or Visibility is above 40<jupyter_code>df[(df['Weather Condition'] == 'Clear') | (df['Visibility_km'] > 40)]<jupyter_output><empty_output><jupyter_text>Find all instances when: Weather Condition is Clear And Relative Humidity is greater than 50 Or Visibility is above 40<jupyter_code>df[(df['Weather Condition'] == 'Clear')  & (df['Rel Hum_%'] > 50) | (df.Visibility_km > 40)]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13580562659846548, 'fraction_numerical': 0.025319693094629156, 'mean_word_length': 7.014344262295082, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 97, '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': '23', 'dir': 'jupyter-structured-clean-dedup', 'id': '663873', 'license': 'MIT', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1422, 'n_words': 240, 'path': 'Data Analytics/Weather Data/Weather Data.ipynb', 'repo_name': 'rahulhgdev/Data-Science', 'size': '3910'}