rnckp / starter-code-opendataswiss-gh Goto Github PK
View Code? Open in Web Editor NEWAutomatically generate starter code notebooks in Python and R for all CSV datasets on opendata.swiss
License: GNU General Public License v3.0
Automatically generate starter code notebooks in Python and R for all CSV datasets on opendata.swiss
License: GNU General Public License v3.0
Continuation of rnckp/starter-code_opendataswiss#2
At one point the starter script creates a line of code like this:
df = get_dataset('https://www.stadt-zuerich.ch/geodaten/download/Baumkataster?format=10008')
but the provided link does not contain a csv file, hence later this code fails in the generated starter script.
I think this could be solved by changeing the following function in the generator script:
def has_csv_distribution(dists):
"""Iterate over package resources and keep only CSV entries in list"""
# <<<<<<<
# Don't look, whether the dataset claims to be a CSV file, but check,
# whether the download url (which will be inserted in get_dataset() later)
# ends with csv:
#csv_dists = [x for x in dists if x.get("format", "") == "CSV"]
csv_dists = [x for x in dists if x.get('download_url', '').lower()[-3:] == 'csv']
# >>>>>>>
if csv_dists != []:
return csv_dists
else:
return np.nan
But this produces ~2000 instead of 2700 starter files, so a thorough investigation is necessary.
I can't provide you with a pull request yet, because I had to make some changes locally to get the script to work. One of them included the addition of encoding='utf-8'
in every file open()
command, otherwise it crashed on my machine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.