Question for Lab 1 - 11:00

(10 pts)

I've got a fun program on my webpage that generates random CSV data for people. You can access it and examine the first few rows via Python like so:

import pandas as pd
df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=mark')
df.head()
first_name last_name age sex height weight income activity_level
0 Donna Dinan 35 female 65.37 164.26 1947 high
1 Antonia Davis 39 female 64.95 140.40 2188 none
2 Stephanie Buss 30 female 60.75 181.83 18108 high
3 Wendell Elmore 26 male 64.68 157.90 1935 moderate
4 Nina Mcilhinney 21 female 59.94 163.38 5675 none

Here's the cool thing - the data is randomly generated but the random number generator is seeded using the username query parameter in the URL. Thus, if I execute that command several times, I get the same result every time. That result depends upon the username, however. Thus, if you do it with your forum username, you'll get a different result. Thus, we all have our own randomly generated data file!

The problem: Using the code above with your username, generate your data file and then

  1. Compute the mean and sample standard deviation of the heights in your data and
  2. create a histogram of the heights.

Be sure to include both the code that you typed, as well as the results in your post.

Comments

  • edited January 27

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=audrey')
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    

    Output: 66.49599999999998

    Finally, here's my histogram:

      df.hist('height', edgecolor='black', grid=False);
    

    mark
  • edited January 29

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv? 
    username=anthonyaversano')
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    # output: 66.7983
    

    The standard deviation of my heights is:

    df.height.std()
    # output: 3.798472860335726
    

    A histogram of my height is:

    df.hist('height') ![] 
    

    mark
  • I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv? 
    username=PinetreeStar')
    

    The mean of my heights is:

    df.height.mean()
    # Output: 66.8235
    

    The standard deviation of my heights is:

    df.height.std()
    # Output: 4.174962499075514
    

    A histogram of my heights is:

    df.hist('height', edgecolor='black', grid=False, bins=[57.5,60,62.5,65,67.5,70,72.5,75]);
    

    mark
  • edited January 27

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Mpallozzi')
    df.head()
    

    The mean of my height is:

    df.height.mean()
    #. Output: 65.73560000000002
    

    The standard deviation of my height is:

    df.height.std()
    #. Output: 3.6443689287569234
    

    Here is my Histogram:

    df.hist('height', edgecolor='black', grid=False,
    

    mark
  • edited January 27

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=evan')
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    Output: 66.20770000000003
    

    Standard deviation:

    df.height.std()
    Output:3.490168255907652`
    

    Histogram:

     df.hist('height');
    

    mark
  • I imported my data like this:

    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=AnnaMagnes')
    print(len(df))
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    # Output: 66.6557
    

    The standard deviation is:

    df.height.std()
    # Output: 3.836129482178671
    

    My histogram:

    df.hist('height', edgecolor='black', grid=False,);
    

    mark
  • My data set is this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=michaela')
    df.head()
    

    The mean of my heights is

    df.height.mean()
    #. Output: 67.3123
    

    The standard deviation of my heights is

    df.height.std()
    #. Output: 3.563894661969705
    

    Here is my histogram

    df.hist('height', edgecolor='black', grid=False);
    

    mark
  • edited January 27

    I imported my data like this:

    df=pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Kylie')
    df.head()
    

    The mean of my height is:

    df.height.mean()
    #. Output: 66.7958
    

    The standard deviation of my height is:

    df.height.std()
    #. Output: df.height.std()
    

    Finally, here's my histogram:

    df.hist('height', edgecolor='black', grid=False,
    

    mark
  • edited January 29
    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=keoni')
    df.head()
    

    My mean is

    df.height.mean()
    #. Output: 66.66900000000004
    

    My standard deviation is

    df.height.std()
    #. Output: 4.087922714681885
    

    My histogram is

    df.hist('height', edgecolor='black', grid=False,)
    

    mark
  • MAAMAA
    edited January 27

    I Imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv? 
    username=MAA')
    df.head()
    

    Mean code:

    df.height.mean()
    

    Standard deiviation code:

    df.height.std()
    

    Histogram code:

    df.hist('height');
    

    mark
  • edited January 27

    I imported my data like this:

  • edited January 29

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=noah')
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    # Output: 67.02449999999999
    

    The standard deviation of my heights is:

    df.height.std()
    # Output: 3.8097767306462633
    

    A histogram of my heights is:

    df.hist('height', edgecolor='black', grid=False,);
    

    mark
  • I imported my data like this:

    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=sepidae')
    print(len(df))
    df.head()
    

    The mean of the height is:

    df.height.mean()
    #Output = 65.539
    

    And the standard deviation is:

    df.height.std()
    #Output = 3.373509547439679
    

    Finally, here's the histogram:

    df.hist('height', edgecolor='black', grid=False,);
    

    mark
  • I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv? 
    username='erinwalsh'
    

    The mean of my height is:

    df.height.mean()
    #.   Output: 66.05620000000002
    

    Here is my histogram:

    df.hist('height', edgecolor 'black', grid=False
    

    mark
  • edited January 29

    I imported my data like this

    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=eriana')
    df.head()
    

    The mean of my height is:

     df.height.mean()
    

    Output:66.81249999999999

    The standard deviation is:

    df.height.std()
    

    Output:4.248674273324336

    mark
  • edited January 29

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=blake')
    df.head()

    The mean of my heights is:
    df.height.mean()

    output:66.711

    The Standard deviation is:
    df.height.std()

    output:3.8964538397435846

    Here is my histogram:
    We had technical difficulties uploading the image

    mark
  • edited January 27

    I imported my data like this:

    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=pheebsjoy')
    df.head()
    

    The mean of my heights is:

    df.height.mean()
    #. Output: 66.07379999999996
    

    The standard deviation is:

    df.height.std()
    #. Output: 3.8900325308291563
    

    finally my histogram is:

    mark
  • edited January 27

    I imported my data like this

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=leahgiven1')
    df.head()
    

    mean height

    df.mean()
    output:66.3857
    

    standard deviation height

     df.height.std()
     output:4.070443416393429 
    

    Histogram height

    mark
  • edited January 27

    I imported my data like this:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv? 
    username=driordan')
    df.head()
    

    Mean height

    df.height.mean()
    66.40280000000001
    

    Standard deviation height

    df.height.std()
    4.127169421570119
    

    The histogram for my given data is as follows:

    mark
  • edited January 28

    Here is my data set

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Mpalmer2')
    

    Here is my histogram

    df.hist('height', edgecolor='black', grid=False);
    

    mean height
    
    df.height.mean()
    66.08630000000002
    
    Standard deviation height
    
     df.height.std()
     3.5759374429594817
    
    mark
  • edited January 29

    this is my data set:

    import pandas as pd
    df = pd.read_csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=ijurek')
    

    here is how i computed the mean height:

    df.height.mean()
    

    output:66.49599999999998

    here is how i computed the standard deviation:

    df.height.std()
    

    output:3.9782326922309807

    this is my histogram:

    df.hist('height', edgecolor='black', grid=False);
    

    histogram

    mark
Sign In or Register to comment.