Este es un ejemplo de clase sobre la manipulacion de los archivos csv usando python
In [26]:
%ls
In [33]:
import pandas as pd
In [46]:
x = pd.read_csv('AportesDiario_2004.csv', sep=';', decimal=',', thousands='.', skiprows=2)
In [47]:
x.head()
Out[47]:
In [48]:
x['Fecha']
Out[48]:
In [49]:
x['Region Hidrologica'] == 'Antioquia'
Out[49]:
In [52]:
n = set(x['Nombre Rio'])
n
Out[52]:
In [62]:
import statistics
for y in n:
z = x [x['Nombre Rio'] == y]['Aportes Energia kWh']
if len(z) > 0:
print(y, statistics.mean(x[x['Nombre Rio']==y]['Aportes Energia kWh'].values[:]))
In [ ]: