Commit 18388e95 authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files

Begin code to extract all stations' files

parent 0d7545a6
......@@ -285,3 +285,41 @@ for i in code_for_test:
# Test
safran_test = pd.read_csv('C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/SAFRAN/A1072010_safran_timeseries.csv', encoding='latin-1')
## Extract 400 stations files and filter size
shp_contour_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/BanqueHydro/Shapes/BassinsVersantsMetropole/BV_4207_stations.shp'
shp_contour = gpd.read_file(shp_contour_filepath)
foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMETRY/'
watershed_code = shp_contour.loc[:,'Code']
code_for_test = watershed_code.loc[0:70]
unexisting_files = pd.DataFrame()
for i in watershed_code:
# for i in code_for_test:
try:
file = gpd.read_file(foldername+i+'.shp')
except:
unexisting_files = unexisting_files.append({'Code': i}, ignore_index = True)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment