import numpy as np
import matplotlib.pyplot as plt

D = np.genfromtxt( "creditcard.csv", delimiter=',', skip_header=1, usecols=(29,30) )

rows=np.where( D[:,1]==1)
fraudulentos = D[rows]
print( fraudulentos.shape )
print( D.shape )

# print( type( D[0,2] ), D[0,2] )

fig, ax = plt.subplots( )

bins = np.linspace(200, 2500, 100)
ax.set_xlabel( "Monto de la transacción" )
ax.set_ylabel( "Porcentaje de la transacción" )
# ax.hist( D[:,0], bins, alpha=1, label="Normales", color='#19323C' )
ax.hist( D[:,0], bins, alpha=1, label="Normales", color='yellow' )
ax.hist( fraudulentos[:,0], bins, alpha=1, label="Fraudulentos", color='#F2545B' )
ax.set_ylim( 0, 100 )
plt.legend(loc='upper right')
plt.show( )
