<jupyter_start><jupyter_text>You are a medical analyst working in a heart center hospital. You get patient checkup data from the administration. As a health analyst, you are asked to take insight from a given dataset. Before analyzing, you must process the data first.  Using dataset (heart.csv) from https://www.kaggle.com/rashikrahmanpritom/heart-attack-analysis-prediction-dataset?select=heart.csv, Obtain patient data with the following criteria:  - Age **above average** data  - Sex **Male** (Sex=1)  - Cholesterol below 150 mg/dl  - Maximum heart rate achieved is not more than 180  **Note**: *Description of column names can be seen in the link provided*<jupyter_code># Import libraries needed
import numpy as np
import pandas as pd
# Data Loading
# A simple way to store big data sets is to use CSV files
df = pd.read_csv('heart.csv')
# simple data exploratory
# used to get the first n rows. This function returns the first n rows for the object based on position
df.head()
df.tail()
# used to get the last n rows. This function returns last n rows from the object based on position.
df.info()
# used to print a concise summary of a DataFrame. This method prints information about a DataFrame including the index 
# dtype and column dtypes, non-null values and memory usage.
df.describe()
# used to view some basic statistical details like percentile, mean, std etc. of a data frame or a series of numeric 
# values.<jupyter_output><empty_output><jupyter_text>Above average ages<jupyter_code># Age average
df['age'].mean()
# To get the above 54 age, we could run this method :
ageAverage = df['age'] > 54.366336633663366
df[ageAverage]<jupyter_output><empty_output><jupyter_text>there are **159** patiets above the age of 54  Male (Sex=1)<jupyter_code># Get to know the male patiens :

malePatiens = df.sex ==1
df[malePatiens]<jupyter_output><empty_output><jupyter_text>Cholesterol below 150 mg/dl<jupyter_code># Get to know list of patients with cholesterol below 150 :

cholesterol = df.chol < 150
df[cholesterol]<jupyter_output><empty_output><jupyter_text>Maximum heart rate achieved below 150<jupyter_code># Get to know list of patients with heart rate below 150 : :

heartRate = df.thalachh < 150
df[heartRate]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.080301685891748, 'fraction_numerical': 0.022626441881100266, 'mean_word_length': 5.16120218579235, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 22, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '411768', 'license': 'MIT', 'n_tokens_mistral': 733, 'n_tokens_neox': 658, 'n_words': 286, 'path': 'Heart Attack Analysis & Prediction Dataset.ipynb', 'repo_name': 'hexmf/heart', 'size': '2254'}