How to use the meteomatics.rounding function in meteomatics

To help you get started, we’ve selected a few meteomatics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meteomatics / python-connector-api / meteomatics / api.py View on Github external
for i in range(len(latlon_tuple_list)):
            df.loc[i * split_point: (i + 1) * split_point, 'lat'] = latlon_tuple_list[i][0]
            df.loc[i * split_point: (i + 1) * split_point, 'lon'] = latlon_tuple_list[i][1]
        # set multiindex
        df = df.set_index(['lat', 'lon', 'validdate'])
    else:
        parameters_ts = [c for c in df.columns if c not in ['station_id']]
        split_point = len(df) / len(latlon_tuple_list)
        if 'station_id' not in df.columns:
            for i in range(len(latlon_tuple_list)):
                df.loc[int(i * split_point): int((i + 1) * split_point), 'station_id'] = latlon_tuple_list[i]

        # set multiindex
        df = df.reset_index().set_index(['station_id', 'validdate'])
        df = df.sort_index()
    df = rounding.round_df(df)
    return df[parameters_ts]