Could you help me solve the first exercise of the final exam of Programming Assignment: Data Validation, I don’t have the slightest idea why it doesn’t give me any points, this is my code, as I understand in Exercise 1: Generate Training Statistics, I must generate the expected value below with this data set train_stats = tfdv.generate_statistics_from_dataframe(train_df, stats_options) right?
this is my code:
### START CODE HERE
train_stats = tfdv.generate_statistics_from_dataframe(train_df, stats_options)
# Assuming you have already generated the statistics and stored them in the 'train_stats' variable
# Get the number of features used
num_features = len(train_stats.datasets[0].features)
# Get the number of examples used
num_examples = train_stats.datasets[0].num_examples
# Get the first feature
first_feature = train_stats.datasets[0].features[0].path.step[0]
# Get the last feature
last_feature = train_stats.datasets[0].features[-1].path.step[0]
# Print the extracted information
print("Number of features used:", num_features)
print("Number of examples used:", num_examples)
print("First feature:", first_feature)
print("Last feature:", last_feature)
### END CODE HERE