<jupyter_start><jupyter_text>Question 1In your homework file you should find a file titled "Luminosity Array.txt". This array comes from data taken by the Sloan Digital Sky Survey (SDSS) and was released as a part of their Data Release 14. This data in particular was gathered by the SPIDERS survey, which aimed to follow up on galaxy clusters found using X-ray surveys with an optical survey. This array in particular is a list of the calculated luminosities of galaxy clusters in the SPIDERS survey in the 0.1-2.4 keV band. You can learn more about SPIDERS here: https://www.sdss.org/surveys/eboss/ (SPIDERS is a sub-survey of the eBOSS survey) and SDSS in general here: https://www.sdss.org/Import Numpy, then load this array. How many entries are in this array? Try to calculate the mean cluster luminosity. What happens? (We expect an output here, not an error code).<jupyter_code>#import here
def luminosity_mean():
    
    return
luminosity_mean()<jupyter_output><empty_output><jupyter_text>---------------------------Array Length: (Answer Here)  Mean Luminosity: (Answer Here)---------------------------- The reason why the mean luminosity isn't what we expect when we attempt to calculate it above is because there are a couple of NaN's (Not a Number's) in our data.   Remove the NaN's from the array and calculate the actual mean luminosity. (Hint: use np.isnan)<jupyter_code>def no_outliers():
    
    return
no_outliers()
luminosity_mean()<jupyter_output><empty_output><jupyter_text>---------------------------------New Mean Luminosity: (Answer Here)-----------------------------------  Question 2Construct an array of the size specified in the function input that repeats the same pattern of 0, 1, and 2 like so:repetition(11) returns 0,1,2,0,1,2,0,1,2,0,1Hint: Use array slicing<jupyter_code>def repetition(size):
    
    return
repetition(11)<jupyter_output><empty_output><jupyter_text>Question 3Import matplotlib.pyplot. Plot f(x)=1/x using a line graph on a log-log plot. Include a title, axes labels, and legend. Then plot g(x)=x on the same plot. Make f(x) a red dashed line, and g(x) a green solid line.<jupyter_code>#import here
def plots():
    
    return
plots()<jupyter_output><empty_output><jupyter_text>Question 4Using the "Redshift Array.txt" and "Luminosity Array.txt" files, plot luminosity vs. redshift on a scatter plot. Include a title and axes labels.<jupyter_code>def scatter():
    
    return
scatter()<jupyter_output><empty_output><jupyter_text>Notice that there is one point on the scatter plot that is much much higher than the others. This point is most likely some sort of outlier. Remove that point (from both the luminosity and redshift arrays - keep in mind that the luminosity is of order 10^45-10^46, even though the y-axis ranges from 0 to ~1.5) and plot the graph again to better see the relationship between the points.<jupyter_code>def improved_scatter():
    
    return<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11099830795262268, 'fraction_numerical': 0.01353637901861252, 'mean_word_length': 3.8940397350993377, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '332332', 'license': 'MIT', 'n_tokens_mistral': 889, 'n_tokens_neox': 824, 'n_words': 374, 'path': 'Fall19 Decal Material/Homework/Week 7_ 1-D Arrays and Plotting/Week 7 1-D Array and Plotting Pset.ipynb', 'repo_name': 'emilyma53/Python_DeCal', 'size': '2955'}