Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Created September 26, 2019 02:19
Show Gist options
  • Save fmasanori/23799823cea9813796ac27283e424719 to your computer and use it in GitHub Desktop.
Save fmasanori/23799823cea9813796ac27283e424719 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"low_memory=False\n",
"pd.options.display.max_columns = 80\n",
"pd.options.display.max_rows = 90"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\fmasa\\appdata\\local\\programs\\python\\python37-32\\lib\\site-packages\\IPython\\core\\interactiveshell.py:3044: DtypeWarning: Columns (3) have mixed types. Specify dtype option on import or set low_memory=False.\n",
" interactivity=interactivity, compiler=compiler, result=result)\n"
]
}
],
"source": [
"df = pd.read_csv('ESCOLAS.CSV', delimiter = '|', encoding='iso-8859-1')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"774"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.query('TP_SITUACAO_FUNCIONAMENTO == 1 and IN_AGUA_INEXISTENTE == 1 and IN_ENERGIA_INEXISTENTE == 1 and IN_ESGOTO_INEXISTENTE == 1')['NO_ENTIDADE'].value_counts().count()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment