This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generic imports | |
import os | |
import imageio | |
import datetime | |
import numpy as np | |
# sentinelhub-py and eo-learn imports | |
from sentinelhub.geometry import BBox | |
from sentinelhub.constants import CRS, DataSource | |
from eolearn.core import EOTask, FeatureType, LinearWorkflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The kernel function is | |
# roughtly equivalent to new[:] = np.interp(xnew, xvals, yvals) | |
# But this is broadcast so that it can be run many, many times | |
# quickly. | |
# Call using ynew = interp1d(xnew, xdata, ydata) | |
# ynew.shape will be xnew.shape | |
# Also, ydata.shape[-1] must be xdata.shape[-1] | |
# and if ydata or xdata have ndim greater than 1, the initial dimensions | |
# must be xnew.shape: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def splitDataFrameList(df,target_column,separator): | |
''' df = dataframe to split, | |
target_column = the column containing the values to split | |
separator = the symbol used to perform the split | |
returns: a dataframe with each entry for the target column separated, with each element moved into a new row. | |
The values in the other columns are duplicated across the newly divided rows. | |
''' | |
def splitListToRows(row,row_accumulator,target_column,separator): | |
split_row = row[target_column].split(separator) |