Giter Site home page Giter Site logo

shouhaddo / python-training Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 11.0 18.75 MB

This is a repository to share my students who are undergoing python training under me codes of everyday lectures provided by me.

Jupyter Notebook 100.00%
python-training students python3 python python-practice learnpython learn-python-fundamentals learn-python-fast python-3-6 python-package programming-language programming-exercises programming-fundamentals python-learning-notes python-learn-exercises python-learning python-learning-journey

python-training's Issues

Average value of a list

Hi friends,
I have a python code, including some calculations ending at a list, for example:
P=[a , b , c, d , e , f , g , h , i , j , k , l], which all are numbers. Consider this list to have, say 12 elements. What I'm going to do is that to separate the elements in a 3 groups as:
P = [ a,b,c,d , e,f,g,h, i,j,k,l]. Then I want to average over this three groups, meaning that to define a new list or array like M whose elements are as follows:

M[0] = (P[0]+P[4]+P[8])/3 = (a+e+i)/3

M[1] = (P[1]+P[5]+P[9])/3 = (b+f+j)/3

M[2] = (P[2]+P[6]+P[10])/3 = (c+g+k)/3

M[0] = (P[3]+P[7]+P[11])/3 = (d+h+l)/3.

Actually, the number of element and the length by which I'm going to separate the elements of the list can vary and be large. So I need to have general code doing so. Does anybody have any idea. It would be appreciated. Thank you.

Not Working

I am unable to see the content i think there is some issue please help me

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.