exam questions

Exam DP-500 All Questions

View all questions & answers for the DP-500 exam

Exam DP-500 topic 1 question 36 discussion

Actual exam question from Microsoft's DP-500
Question #: 36
Topic #: 1
[All DP-500 Questions]

You are creating a Python visual in Power BI Desktop.
You need to retrieve the value of a column named Unit Price from a DataFrame.
How should you reference the Unit Price column in the Python code?

  • A. dataset[‘Unit Price’]
  • B. (‘Unit Price’)
  • C. pandas.DataFrame(‘Unit Price’)
  • D. data = [Unit Price]
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JasonVu
Highly Voted 2 years, 6 months ago
I think answer should be A
upvoted 15 times
...
louisaok
Highly Voted 2 years, 5 months ago
Selected Answer: A
it should be A. dataset[‘Unit Price’], => (return a column) pandas.DataFrame(‘Unit Price’), => (show the entire table)
upvoted 8 times
...
DarioReymago
Most Recent 1 year, 2 months ago
Selected Answer: C
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals
upvoted 1 times
...
sheilawu
1 year, 8 months ago
Selected Answer: A
definitely a is the answer
upvoted 1 times
...
PrudenceK
1 year, 11 months ago
Selected Answer: A
dataset[‘Unit Price’] is correct answer
upvoted 1 times
...
PrudenceK
1 year, 11 months ago
Selected Answer: A
This syntax accesses the Unit Price column by specifying the column name within square brackets after the dataset object. Using dataset['Unit Price'] retrieves the values from the specified column for further processing or visualization in the Python visual.
upvoted 1 times
...
Eltooth
1 year, 11 months ago
Selected Answer: A
A is correct answer.
upvoted 1 times
...
Plb2
1 year, 11 months ago
Selected Answer: A
Should be A
upvoted 2 times
...
ameer989
1 year, 12 months ago
Selected Answer: A
A is the correct answer, been developing python scripts for years now and i only used dataset['column name']
upvoted 2 times
...
missinglilo
1 year, 12 months ago
From ChatGPT: The correct answer is A. dataset[‘Unit Price’]. This is the correct way to reference the Unit Price column in the Python code.
upvoted 2 times
...
dev2dev
2 years, 1 month ago
Selected Answer: A
C is WRONG!
upvoted 3 times
...
DarioReymago
2 years, 2 months ago
Selected Answer: A
Is correct A https://pandas.pydata.org/docs/getting_started/intro_tutorials/03_subset_data.html
upvoted 4 times
...
HN_3532
2 years, 3 months ago
A is correct since it's how you select a column in pandas dataframe. https://pandas.pydata.org/docs/getting_started/intro_tutorials/03_subset_data.html C is to initialize a new dataframe. In this case it will initialize a dataframe with each character as a column value (string is an iterable in Python) https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html
upvoted 3 times
...
AValester
2 years, 4 months ago
Selected Answer: A
A. Sure
upvoted 3 times
Fer079
2 years, 4 months ago
do you have any example or reference?
upvoted 1 times
...
...
taza31
2 years, 4 months ago
Selected Answer: A
Question is so bad but the forst param for a dataframe is data and a string cannot be dataset column just an index So for me A https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html
upvoted 3 times
...
master_artyom1983
2 years, 5 months ago
I think A, because: You can access columns in the dataset by using their names. For example, you can code dataset["Age"] in your Python script to access the age field.
upvoted 2 times
...
abain89
2 years, 5 months ago
I think A works
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...