Giter Club home page Giter Club logo

2023-homework04-grets29's Introduction

Review Assignment Due Date

Homework 4 - Basic NumPy

The deadline of this homework is on Tuesday, 16th of May, 23:59:00 UTC+2.

In this homework you should implement three different functions in their respective files.

1 Strange Pattern

You come across this strange pattern.

x x x
x x
x x x
x x x
x x
x x x

Mesmerized, you decide you must write a function to generate arbitrary sizes of it. (Write a function strange_pattern that takes a shape tuple (n, m) as input and generates a boolean (True for x's and False for blank spaces) 2D NumPy array of the given shape with this pattern)

Hint: Perhaps this strange symbol might help? ::

2 Gaussian analysis

Write a function gaussian_analysis which takes four parameters loc, scale, lower_bound and upper_bound and returns a tuple of two values (mean, std). First of all the function should make sure that loc, scale, lower_bound and upper_bound are integers or floats and that lower_bound is smaller than upper_bound and should return meaningful error messages if those are not the case. In the function 100 samples of a gaussian distribution should be drawn in respect to the given loc and scale parameters. Check out the Numpy documentation to find out which function you could use here. Next, the values below the lower_bound and above the upper_bound should be filtered out. Afterwards you should calculate the mean and the std(standard deviation) of the array and return them in a tuple.

3. Combination of arrays

Write a function combination that takes in two numpy arrays and an optional parameter axis which should be 0 by default. Remove unnecessary dimensions of the input arrays, check whether they can be combined along the given axis and return the combined array. If the combination is not possible, raise a meaningful error message.

Good luck!

2023-homework04-grets29's People

Contributors

github-classroom[bot] avatar

Watchers

Chris Stenkamp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.