# Kindly help me. I am struggling to submit my assignment

sub got incompatible shapes for broadcasting: (3,), (50,).

This is the code i submitted:

# Print some elements and mean values of the prices_A and prices_B arrays.

print(“Some prices of supplier A:”, prices_A[0:5])
print(“Some prices of supplier B:”, prices_B[0:5])
print(“Average of the prices, supplier A:”, np.mean(prices_A))
print(“Average of the prices, supplier B:”, np.mean(prices_B))

I removed your code solution as its not allowed to publish it publicly!

Clearly here the issue should be with your solution, it means that an operation cannot be performed because the operands do not have the right compatible shapes

May I know your question is from what course? I would change the category. It shouldn’t be in AI Discussions.

Yes, It is “calculus for Machine Learning and Data Science”.

This is the exercise " Load the historical prices of supplier A and supplier B into variables `prices_A` and `prices_B` , respectively. Convert the price values into `NumPy` arrays with elements of type `float32` using `np.array` function."

How about the week? For now, I set it to week 1.

Hello @Uzair_Rasheed

you are failing the test because the hints given for the particular grade cell

• The corresponding prices are in the DataFrame `df`, columns `price_supplier_a_dollars_per_item` and `price_supplier_b_dollars_per_item`.
• Conversion into the `NumPy` array can be performed with the function `np.array`.

So to recall prices_A as df.price_supplier_a_dollars_per_item, same for prices B
Then for conversion instruction mentions
Convert the price values into `NumPy` arrays with elements of type `float32` using `np.array` function.

so using np.array was perfectly correct, but using astype with np.float32 is incorrect. you only need to use (‘float32’)

Regards
DP