Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def data(self):
data = gsod.get_data(self.catalog_entry, start=self.start, end=self.end,
parameters=self.parameter_code)
if not data or not data[self.catalog_entry]:
raise ValueError('No Data Available')
data = data[self.catalog_entry]
data = pd.DataFrame(data)
if data.empty:
raise ValueError('No Data Available')
data = data.set_index('date')
data.index = pd.PeriodIndex(data.index, freq='D')
data.rename(columns={self.parameter_code: self.parameter}, inplace=True)
return data