ComenzarEmpieza gratis

From a CSV file

CSV files are a common way to store tabular data, and pandas is the easiest way to read them into Python. And easy is no exaggeration, you only need one function to import a CSV file with pandas, and it automatically converts the file to a DataFrame.

In this exercise, you are going to explore the pandas function read_csv() and its arguments to read in a CSV file, which contains records of wildlife strikes. Before starting, run help(pd.read_csv) in the console to view the arguments for the read_csv() function. There are many, but understanding your options will save you lots of time when importing your data.

Este ejercicio forma parte del curso

Python for MATLAB Users

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Load strikes from strikes.csv
strikes = pd.read_csv('____')

print(strikes.head())
Editar y ejecutar código