Question
1. Given the DataFrame object df, how would you save it to a csv file? Group of answer choices df.to_csv('file_name') df.write_csv('file_name') pd.write_csv('file_name') pd.to_csv('file_name') 2. Consider
1. Given the DataFrame object df, how would you save it to a csv file?
Group of answer choices
- df.to_csv('file_name')
- df.write_csv('file_name')
- pd.write_csv('file_name')
- pd.to_csv('file_name')
2. Consider a DataFrame df which looks like: ('Name' column had been set as Index)
Name | Age | Date_Of_Joining | Total_Experience |
Neil | 22 | 01/02/2013 | 2 |
Ruth | 30 | 01/04/2014 | 10 |
Sandy | 10 | 0 | 0 |
Joshua | 40 | 01/10/2009 | 20 |
Which command will access the record of 'Joshua'? (Choose all that apply.)
Group of answer choices
- df.loc['Joshua',:]
- df.iloc[3]
- df['Joshua']
- df.loc[3,:]
3. Consider a DataFrame, df, which looks like: ('Name' column had been set as Index)
Name | Age | Date_Of_Joining | Total_Experience |
Neil | 22 | 01/02/2013 | 2 |
Ruth | 30 | 01/04/2014 | 10 |
Sandy | 10 | 0 | 0 |
Joshua | 40 | 01/10/2009 | 20 |
Which of the following will you use to access only the Age and Date_Of_Joining of 'Sandy'? (Choose all that apply.)
Group of answer choices
- df.loc[2,1:3]
- df.iloc[3, 1:3]
- df.iloc[2, :2]
- df.loc['Sandy' , 'Age' : 'Date_Of_Joining']
4. What's the use of the Pandas get_dummies method?
- Exchange values between two columns
- Convert one categorical column into multiple dummy columns with value 0 or 1
- Convert multiple dummy columns into one categorical column with variable values
- Fills the categorical column with 0 value
5. Which method is used to show the summary statistics of a DataFrame?
Group of answer choices
- describe()
- head()
- corr()
- info()
6. The apply() function is used to apply a function along an axis of the DataFrame, essentially a Pandas way to perform iterations on columns/rows
Group of answer choices
- TRUE
- FALSE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started