<jupyter_start><jupyter_text>Import module homework.py as hm2<jupyter_code>import homework2 as hm2<jupyter_output><empty_output><jupyter_text>1. Apply the function in hm2 module to load the data from the link preview the data<jupyter_code>url="https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD" # try other link to test the code, need ""
df=hm2.read_url(url)
df<jupyter_output><empty_output><jupyter_text>2. Use the function "test_create_dataframe" in the module hm2 to examine if the data hold the following conditions: The DataFrame contains only the columns that you specified as the second argument. The values in each column have the same python type There are at least 10 rows in the DataFrame. (This function also prints the details of each condition)<jupyter_code>column_name=["Date","Fremont Bridge East Sidewalk","Fremont Bridge West Sidewalk"] # try other column names to test the code
result=hm2.test_create_dataframe(df,column_name)<jupyter_output>There are at least 10 rows in the DataFrame - True
The DataFrame contains only the columns that you specified as the second argument - True
The values in each column have the same python type - False<jupyter_text>The result (True/False):<jupyter_code>result<jupyter_output><empty_output>