Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. #This is a sample Data Challenge
  2. #Learn more: https://stepik.org/lesson/9172
  3. import requests
  4. import pandas as pd
  5. import numpy as np
  6. from io import BytesIO
  7.  
  8.  
  9. def generate():
  10.     return 'Link for your test dataset'
  11.  
  12.  
  13. def solve(dataset):
  14.     r=requests.get('https://docs.google.com/spreadsheets/d/1HRwbciBvboRdIx29Cl1QL97b2RlamwBvLpwhx6cXR9k/export?format=csv')
  15.     data = r.content
  16.     df_true_file = pd.read_csv(BytesIO(data))
  17.     return df_true_file
  18.  
  19.  
  20. def check(reply, clue):
  21.    
  22.     clue = pd.read_csv(clue)
  23.     comparison = reply.to_numpy() == clue.to_numpy()
  24.     accuracy = np.count_nonzero(comparison)/np.size(comparison)
  25.     return round(accuracy, 1)
  26.    
  27.  
  28. tests = []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement