Ejemplo n.º 1
0

def compute_weather_dataframe_event_metadata(dataframe):
    return [
        EventMetadataEntry.text(str(len(dataframe)), 'n_rows',
                                'Number of rows seen in the dataframe'),
        EventMetadataEntry.text(str(dataframe.columns), 'columns',
                                'Keys of columns seen in the dataframe'),
    ]


WeatherDataFrameSchema = [
    PandasColumn.datetime_column('time', unique=True),
    PandasColumn.string_column('summary'),
    PandasColumn.categorical_column(
        'icon',
        categories={'clear-day', 'cloudy', 'fog', 'partly-cloudy-day',
                    'rain'}),
    PandasColumn.integer_column('sunriseTime', min_value=0),
    PandasColumn.integer_column('sunsetTime', min_value=0),
    PandasColumn.float_column('precipIntensity', min_value=0.0, max_value=1.0),
    PandasColumn.float_column('precipIntensityMax',
                              min_value=0.0,
                              max_value=1.0),
    PandasColumn.float_column('precipProbability',
                              min_value=0.0,
                              max_value=1.0),
    PandasColumn.float_column('temperatureHigh',
                              min_value=40.0,
                              max_value=100.0),
    PandasColumn.integer_column('temperatureHighTime', min_value=0),
    PandasColumn.float_column('temperatureLow',
Ejemplo n.º 2
0

def compute_weather_dataframe_event_metadata(dataframe):
    return [
        EventMetadataEntry.text(str(len(dataframe)), "n_rows",
                                "Number of rows seen in the dataframe"),
        EventMetadataEntry.text(str(dataframe.columns), "columns",
                                "Keys of columns seen in the dataframe"),
    ]


WeatherDataFrameSchema = [
    PandasColumn.datetime_column("time", unique=True),
    PandasColumn.string_column("summary"),
    PandasColumn.categorical_column(
        "icon",
        categories={"clear-day", "cloudy", "fog", "partly-cloudy-day",
                    "rain"}),
    PandasColumn.integer_column("sunriseTime", min_value=0),
    PandasColumn.integer_column("sunsetTime", min_value=0),
    PandasColumn.float_column("precipIntensity", min_value=0.0, max_value=1.0),
    PandasColumn.float_column("precipIntensityMax",
                              min_value=0.0,
                              max_value=1.0),
    PandasColumn.float_column("precipProbability",
                              min_value=0.0,
                              max_value=1.0),
    PandasColumn.float_column("temperatureHigh",
                              min_value=40.0,
                              max_value=100.0),
    PandasColumn.integer_column("temperatureHighTime", min_value=0),
    PandasColumn.float_column("temperatureLow",
Ejemplo n.º 3
0
 PandasColumn.categorical_column(
     'summary',
     categories={
         'Partly cloudy throughout the day.',
         'Mostly cloudy throughout the day.',
         'Clear throughout the day.',
         'Light rain in the morning and afternoon.',
         'Light rain starting in the afternoon.',
         'Rain throughout the day.',
         'Overcast throughout the day.',
         'Foggy in the morning and afternoon.',
         'Light rain in the morning.',
         'Possible drizzle in the morning.',
         'Light rain throughout the day.',
         'Possible drizzle in the evening and overnight.',
         'Rain starting in the afternoon.',
         'Light rain until morning, starting again in the evening.',
         'Foggy starting in the afternoon.',
         'Light rain in the morning and overnight.',
         'Light rain overnight.',
         'Light rain in the evening and overnight.',
         'Drizzle in the morning and afternoon.',
         'Rain overnight.',
         'Light rain until evening.',
         'Possible drizzle in the morning and afternoon.',
         'Possible drizzle overnight.',
         'Light rain in the afternoon and evening.',
         'Drizzle in the afternoon and evening.',
         'Rain until morning, starting again in the evening.',
         'Drizzle until morning, starting again in the evening.',
         'Possible drizzle in the afternoon and evening.',
         'Foggy throughout the day.',
         'Possible drizzle until morning, starting again in the evening.',
         'Foggy until evening.',
         'Possible light rain until evening.',
         'Foggy in the morning.',
         'Rain until evening.',
         'Drizzle starting in the afternoon.',
         'Rain in the morning and afternoon.',
         'Possible drizzle throughout the day.',
         'Possible light rain throughout the day.',
         'Heavy rain until morning, starting again in the evening.',
         'Foggy overnight.',
         'Rain in the evening and overnight.',
         'Rain in the morning.',
     },
 ),