classifier-project/data_preprossing.ipynb
2021-10-04 15:21:33 +00:00

50 lines
1007 B
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"df = pd.read_csv(\"responses_clean.csv\", sep=\"|\")\n",
"\n",
"labels = [\"Very Low\", \"Low\", \"Mid\", \"High\", \"Very High\"]\n",
"\n",
"df['SalaryUSD'] = pd.qcut(df['SalaryUSD'], q = 5, labels=labels)\n",
"\n",
"df.to_csv(\"responses_discretized.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (default)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}