python-pandas 答题

1. What is a correct syntax to add the lables "x", "y", and "z" to a Pandas Series?

python-pandas 答题_第1张图片

2. What is a correct syntax to return the entire DataFrame

python-pandas 答题_第2张图片

3. For the Pandas head() method, how many rows are returned by default, if you do not specify it?

5 rows

The head() method returns the first 5 rows if a number is not specified.

4. True or false: by default, the Pandas dropna() method returns a new DataFrame, and will not change the original.

Note: By default, the dropna() method returns a new DataFrame, and will not change the original.

If you want to change the original DataFrame, use the inplace = True argument:

5. What is a correct method to fill empty cells with a new value?

fillna()  

6. Mean, Median, Mode. Which one returns the value in the middle?

median()  

7. Mean, Median, Mode. Which one returns the value that appears most frequently?

mode()  

8. Mean, Median, Mode. Which one returns the average value?

mean()  

9. What is a correct method to remove duplicates from a Pandas DataFrame?

df.drop_duplicates()  

你可能感兴趣的:(python,pandas,css)