Order CSV by Head

Hello Guys

Again I ask for help, I am new to this Jupyter Notebook topic and I need if you can help in the following:

I have a csv with 1000 records, where it shows data of those enrolled in a course. This has the following columns

Year, Sex, City, Age

I need you to show me, for example, the sum of all those enrolled in each city, and the sum of all those enrolled per year.


Year;Total Register by year
2014 2

City; Total Register
Lima 2

The csv show

Year;City; Age; Sex
2010;Buenos Aires;38,Female

So far I have done the following:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
import seaborn as sb

%matplotlib inline
plt.rcParams[‘figure.figsize’] = (16, 9)

from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.naive_bayes import GaussianNB
from sklearn.feature_selection import SelectKBest

dataframe = pd.read_csv(‘Register.csv’,sep=‘;’, header=None,low_memory=False,encoding=‘latin-1’,on_bad_lines=‘skip’)

Is posible your comments of how can i make this order


This isn’t a Jupyter issue. You’d have the same issue if you were running your code as a script or directly in the interpreter console.
Read up on how to use Pandas. There’s a lot of resources.