text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

lung_df = pd.read_csv('/kaggle/input/lung-cancer/survey lung cancer.csv')

lung_df = lung_df.dropna(how='any')

lung_df['LUNG_CANCER'] = lung_df['LUNG_CANCER'].map({'NO': 0, 'YES': 1})
sns.barplot(data=lung_df, x='GENDER', y='LUNG_CANCER')
plt.xlabel('Gender')
plt.ylabel('Probability of Lung Cancer')
plt.title('Lung Cancer Presence by Gender')
plt.show()