
Answer-first summary for fast verification
Answer: No
The solution does not meet the goal because Dataset.File.from_files() creates a FileDataset, which does not have a to_pandas_dataframe() method. FileDataset is designed for file operations like downloading or mounting files, not for directly creating pandas DataFrames from tabular data. To load CSV data into a single DataFrame, Dataset.Tabular.from_delimited_files() should be used instead, as it creates a TabularDataset that supports the to_pandas_dataframe() method. The community discussion confirms this, with the highest upvoted comments and the official answer indicating 'No' is correct. While some comments suggest 'Yes', they are either outdated or incorrect based on the Azure ML documentation and API specifications.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You create an Azure Machine Learning datastore containing the following files:
/data/2018/Q1.csv/data/2018/Q2.csv/data/2018/Q3.csv/data/2018/Q4.csv/data/2019/Q1.csvAll files have the following format:
id,f1,f2,l
1,1,2,0
2,1,1,1
3,2,1,0
4,2,2,1
id,f1,f2,l
1,1,2,0
2,1,1,1
3,2,1,0
4,2,2,1
You run the following code:
from azureml.core import Dataset, Datastore, Workspace
ws = Workspace.from_config()
datastore = Datastore.get(ws, 'your_datastore_name')
from azureml.core import Dataset, Datastore, Workspace
ws = Workspace.from_config()
datastore = Datastore.get(ws, 'your_datastore_name')
You need to create a dataset named training_data that loads the data from all files into a single DataFrame using this code:
training_data = dataset.to_pandas_dataframe()
training_data = dataset.to_pandas_dataframe()
Solution: Run the following code:
dataset = Dataset.File.from_files(path=(datastore, '/data/*/*.csv'))
training_data = dataset.to_pandas_dataframe()
dataset = Dataset.File.from_files(path=(datastore, '/data/*/*.csv'))
training_data = dataset.to_pandas_dataframe()
Does the solution meet the goal?

A
Yes
B
No
No comments yet.