IniziaInizia gratis

Reading files with pandas

In real-world projects, data lives in files, not dictionaries. Whether you're building an e-commerce platform, implementing analytics dashboards, or debugging transaction issues, quickly loading and inspecting your data is the critical first step.

pandas makes this effortless - you can load files and immediately check column types, memory usage, and missing values, helping you catch data quality issues early.

A sales.csv file with user IDs, dates, and order values columns has been loaded for you.

Questo esercizio fa parte del corso

Intermediate Python for Developers

Visualizza il corso

Istruzioni dell'esercizio

  • Read in "sales.csv", saving as sales_df.
  • Display the DataFrame info.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Import pandas
import pandas as pd

# Read in sales.csv
sales_df = pd.____("____")

# Display the DataFrame info
print("--- DataFrame Info ---")
print(sales_df.____())
Modifica ed esegui il codice