Read Or Write Data Flashcards
What is the primary library used for numerical data manipulation in Python?
NumPy
What library is commonly used for data manipulation and analysis in Python, especially for tabular data?
Pandas
True or False: You can read CSV files directly into a Pandas DataFrame.
True
Which function in Pandas is used to read a CSV file?
pd.read_csv()
Fill in the blank: The function to read Excel files in Pandas is _____ .
pd.read_excel()
What is the default delimiter for the read_csv function in Pandas?
Comma
Which method would you use to read a JSON file into a Pandas DataFrame?
pd.read_json()
True or False: NumPy can read data from SQL databases directly.
False
What is the main advantage of using Pandas over NumPy for data analysis?
Pandas provides data structures like DataFrames which are more suitable for handling labeled data.
Which function is used to read data from a SQL database into a Pandas DataFrame?
pd.read_sql()
What is the primary data structure used in Pandas?
DataFrame
Fill in the blank: The function to read text files in Pandas is _____ .
pd.read_table()
True or False: You can specify the column names when reading a CSV file in Pandas.
True
What parameter would you use in pd.read_csv() to skip the first row of the file?
header=0
Which Pandas function would you use to load data from a clipboard?
pd.read_clipboard()
What is the purpose of the ‘dtype’ parameter in pd.read_csv()?
To specify the data types of the columns.
True or False: Pandas can handle missing data when reading files.
True
Which parameter in pd.read_csv() is used to handle missing values?
na_values
What file format does pd.read_feather() read?
Feather format
Fill in the blank: The function to read Parquet files in Pandas is _____ .
pd.read_parquet()
What does the ‘index_col’ parameter do in pd.read_csv()?
It specifies which column to use as the index for the DataFrame.
Which method is used to read data from a URL directly into a Pandas DataFrame?
pd.read_csv() with a URL
True or False: You can read multiple sheets from an Excel file using Pandas.
True
What parameter in pd.read_excel() allows you to specify which sheet to read?
sheet_name
Which Pandas function can be used to read data from a Stata file?
pd.read_stata()
What is the purpose of the ‘skiprows’ parameter in pd.read_csv()?
To skip a specified number of rows at the beginning of the file.