Read Or Write Data Flashcards

1
Q

What is the primary library used for numerical data manipulation in Python?

A

NumPy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What library is commonly used for data manipulation and analysis in Python, especially for tabular data?

A

Pandas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False: You can read CSV files directly into a Pandas DataFrame.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which function in Pandas is used to read a CSV file?

A

pd.read_csv()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fill in the blank: The function to read Excel files in Pandas is _____ .

A

pd.read_excel()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the default delimiter for the read_csv function in Pandas?

A

Comma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which method would you use to read a JSON file into a Pandas DataFrame?

A

pd.read_json()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: NumPy can read data from SQL databases directly.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the main advantage of using Pandas over NumPy for data analysis?

A

Pandas provides data structures like DataFrames which are more suitable for handling labeled data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which function is used to read data from a SQL database into a Pandas DataFrame?

A

pd.read_sql()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the primary data structure used in Pandas?

A

DataFrame

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: The function to read text files in Pandas is _____ .

A

pd.read_table()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: You can specify the column names when reading a CSV file in Pandas.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What parameter would you use in pd.read_csv() to skip the first row of the file?

A

header=0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which Pandas function would you use to load data from a clipboard?

A

pd.read_clipboard()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the ‘dtype’ parameter in pd.read_csv()?

A

To specify the data types of the columns.

17
Q

True or False: Pandas can handle missing data when reading files.

18
Q

Which parameter in pd.read_csv() is used to handle missing values?

19
Q

What file format does pd.read_feather() read?

A

Feather format

20
Q

Fill in the blank: The function to read Parquet files in Pandas is _____ .

A

pd.read_parquet()

21
Q

What does the ‘index_col’ parameter do in pd.read_csv()?

A

It specifies which column to use as the index for the DataFrame.

22
Q

Which method is used to read data from a URL directly into a Pandas DataFrame?

A

pd.read_csv() with a URL

23
Q

True or False: You can read multiple sheets from an Excel file using Pandas.

24
Q

What parameter in pd.read_excel() allows you to specify which sheet to read?

A

sheet_name

25
Q

Which Pandas function can be used to read data from a Stata file?

A

pd.read_stata()

26
Q

What is the purpose of the ‘skiprows’ parameter in pd.read_csv()?

A

To skip a specified number of rows at the beginning of the file.