import io
import pandas as pd
data = pd.read_csv("LoanStats_2018Q1.csv", skiprows=1, skipfooter=2, engine='python')
print(data)
>>> data["loan_amnt"] 0 5000.0 1 2500.0 2 2400.0 3 10000.0 4 3000.0 5 5000.0 6 7000.0 7 3000.0 8 5600.0 9 5375.0 10 6500.0 11 12000.0 12 9000.0 13 3000.0 14 10000.0 15 1000.0 16 10000.0 17 3600.0 18 6000.0 19 9200.0 20 20250.0 21 21000.0 22 10000.0 23 10000.0 24 6000.0 25 15000.0 26 15000.0 27 5000.0 28 4000.0 29 8500.0 ... 42506 6725.0 42507 2000.0 42508 6000.0 42509 5350.0 42510 1900.0 42511 10000.0 42512 2000.0 42513 6000.0 42514 4400.0 42515 1200.0 42516 5000.0 42517 1400.0 42518 1000.0 42519 5000.0 42520 2500.0 42521 3000.0 42522 2600.0 42523 1000.0 42524 6450.0 42525 1275.0 42526 10500.0 42527 3000.0 42528 3000.0 42529 2000.0 42530 6500.0 42531 3500.0 42532 1000.0 42533 2525.0 42534 6500.0 42535 5000.0 Name: loan_amnt, Length: 42536, dtype: float64
Nota:
skipfooter
no puede ser usado con el motor de C (usado por defecto). Se debe usar Python para parsear el fichero. Si no se indica explícitamente medianteengine="python"
tendremos un warning, aunque se usará Python automáticamente y el csv será cargado correctamente.