Discover offers online banking, reward credit cards, home equity loans, and personal loans to help meet your financial needs. Learn more about Discover credit cards and apply for the best one for you, whether you need cash back, miles, a student credit card or a secured credit card. Register your Discover Credit Card, Banking, Home Loan, Student Loan or Personal Loan account for online access.

Understanding the Context

Get to know Discover Financial Services. Learn about our company, our products, and our corporate culture. Plus, check news, investor relations, and careers. About Discover - Credit Cards, Banking, Loans and More | Discover Card Discover will automatically match all the cash back you earn at the end of your first year after you open your new Discover it ® cash back card.

Key Insights

1 So if you earn $50 cash back, we'll give you another $50. The shape attribute for numpy arrays returns the dimensions of the array. If Y has n rows and m columns, then Y.shape is (n,m). So Y.shape[0] is n. python - What does .shape [] do in "for i in range (Y.shape [0 ...

Final Thoughts

Shape n, expresses the shape of a 1D array with n items, and n, 1 the shape of a n-row x 1-column array. (R,) and (R,1) just add (useless) parentheses but still express respectively 1D and 2D array shapes, Parentheses around a tuple force the evaluation order and prevent it to be read as a list of values (e.g. in function calls). On the other hand, x.shape is a 2-tuple which represents the shape of x, which in this case is (10, 1024). x.shape[0] gives the first element in that tuple, which is 10. Here's a demo with some smaller numbers, which should hopefully be easier to understand.