Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why can not pass the validation of type of the series

I do not know why it can not pass the validation of each variable.

marvel_df = rate_df.loc[rate_df['Company']== "Marvel"]
mean_marvel =marvel_df[['Rate']].mean()
std_marvel =marvel_df[['Rate']].std()
n_marvel = marvel_df[['Rate']].count()

dc_df = rate_df.loc[rate_df['Company']== "DC"]
mean_dc =dc_df[['Rate']].mean()
std_dc =dc_df[['Rate']].std()
n_dc =dc_df[['Rate']].count()

# Validation
assert n_marvel == 23
assert n_dc == 16
assert np.ndim(mean_marvel) == np.ndim(mean_dc) == np.ndim(std_marvel) == np.ndim(std_dc) == np.ndim(n_marvel) == np.ndim(n_dc)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try it with this cleaned up code:

marvel_df = rate_df[rate_df['Company'] == "Marvel"]
mean_marvel = marvel_df['Rate'].mean()
std_marvel = marvel_df['Rate'].std()
n_marvel = marvel_df['Rate'].count()

dc_df = rate_df[rate_df['Company'] == "DC"]
mean_dc = dc_df['Rate'].mean()
std_dc = dc_df['Rate'].std()
n_dc = dc_df['Rate'].count()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading