Statistics and Linear Algebra 6

Source: Internet
Author: User

1. Ways to get a column of another column with max/min values:

A. Most_bars_country = flags["name"][flags["Bars"].idxmax ()]

B. bars_sorted = flags.sort_values ("Bars", ascending=[0])

Most_bars_country = bars_sorted["Name"].iloc[0]

2. The probability of a certain value in a column:

orange_probability = flags[flags["Orange"]==1].shape[0]/flags.shape[0]

3. The calculate combination by using factorial: 

  Import Math
def find_outcome_combinations (N, k): # Calculate The numerator of our formula.
Numerator = math.factorial (N) # Calculate the denominator.
Denominator = math.factorial (k) * math.factorial (n-k) # Divide them to get the final value.
Return Numerator/denominator

4.

Statistics and Linear Algebra 6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.