def get_input_data_from_movement_df(movement_df, datestring, snapshot_keys):
    """
    Returns a dictionary with data on the form:
    "dock_group_id": {
        "movement_probabilities: {end_dock_id: prob (float)},
        "avg_trip_duration": {end_dock_id: avg_trip_dur_seconds},
        }
    """

    data = dict()
    mf = movement_df
    # remove stations that are not in dockgroup snapshot query
    mf = mf[(mf.start_dock_id.isin(snapshot_keys)) & (mf.end_dock_id.isin(snapshot_keys))]

    g = mf.groupby("start_dock_id")
    all_dock_ids = [data[0] for data in g]

    for info in g:
        id = info[0]
        df = info[1].copy()

        total_trips = df.num_trips.sum()
        df["move_probability"] = df.num_trips/total_trips

        move_prob = dict(zip(df.end_dock_id, df.move_probability))
        avg_trip_duration = dict(zip(df.end_dock_id, df.avg_duration_in_seconds))

        # add 0s for stations that havent been visited
        for dock_id in all_dock_ids:
            if dock_id not in move_prob:
                move_prob[dock_id] = 0
                avg_trip_duration[dock_id] = 60*60

        dock_info = dict()
        dock_info["movement_probabilities"] = move_prob
        dock_info["avg_trip_duration"] = avg_trip_duration

        data[id] = dock_info

    return data