본문 바로가기
PYTHON

PANDAS 문제[PYTHON개발]

by cellin 2023. 11. 2.

PANDAS 문제

대표사진 삭제
  • 오른쪽 정렬왼쪽 정렬가운데 정렬
  •  
  • 사진 편집
  •  
  • 작게문서 너비옆트임
  •  
  • 삭제

사진 설명을 입력하세요.

 

 

Question 1: What is a correct syntax to create a Pandas Series from a Python list?

Correct answer: pd.Series(mylist)

 

Question 2: What is a correct syntax to return the first value of a Pandas Series?

Correct answer: myseries[0]

 

Question 3: What is a correct syntax to add the labels "x", "y", and "z" to a Pandas Series?

Correct answer: pd.Series(mylist, index=["x", "y", "z"])

 

Question 4: What is a correct syntax to create a Pandas DataFrame?

Correct answer: pd.DataFrame(data)

 

Question 5: What is a correct syntax to return the first row in a Pandas DataFrame?

Correct answer: df.loc[0]

 

Question 6: What is a correct syntax to return both the first row and the second row in a Pandas DataFrame?

Correct answer: df.loc[[0, 1]]

 

Question 7: What is the correct Pandas function for loading CSV files into a DataFrame?

Correct answer: pd.read_csv()

 

Question 8: What is a correct syntax to return the first 20 rows of a DataFrame?

Correct answer: df.head(20)

 

Question 9: What is a correct syntax to return the entire DataFrame?

Correct answer: df.to_string()

 

Question 10: What is the correct Pandas function for loading JSON files into a DataFrame?

Correct answer: pd.read_json()

 

Question 11: What is a correct syntax to load a Python Dictionary called "data" into a Pandas DataFrame?

Correct answer: pd.DataFrame(data)

 

Question 12: What does the Pandas head() method do?

Correct answer: Returns the headers and the specified number of rows, starting from the top

 

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

Correct answer: 5

 

Question 14: What is a correct Pandas method for returning the last rows?

Correct answer: df.tail()

 

Question 15: What is a correct Pandas method for removing rows that contain empty cells?

Correct answer: df.dropna()

 

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

Correct answer: True

 

Question 17: What is a correct method to fill empty cells with a new value?

Correct answer: df.fillna()

 

Question 18: When using the Pandas dropna() method, what argument allows you to change the original DataFrame instead of returning a new one?

Correct answer: dropna(inplace=True)

 

Question 19: Mean, Median, Mode. Which one returns the value in the middle?

Correct answer: median()

 

Question 20: Mean, Median, Mode. Which one returns the value that appears most frequently?

Correct answer: mode()

 

Question 21: Mean, Median, Mode. Which one returns the average value?

Correct answer: mean()

 

Question 22: What is a correct method to remove duplicates from a Pandas DataFrame?

Correct answer: df.drop_duplicates()

 

Question 23: What is a correct method to discover if a row is a duplicate?

Correct answer: df.duplicated()

 

Question 24: What is a correct method to find relationships between columns in a DataFrame?

Correct answer: df.corr()

 

Question 25: What is a correct method to plot (draw) diagrams from the data in a DataFrame?

Correct answer: df.plot()

 

 

 

 

 

 

 

 

사진: UnsplashNoah Windler

728x90
반응형