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
import tensorflow as tf | |
import pickle | |
import pandas as pd | |
#Read DataFrame from CSV | |
csv_file = pd.read_csv('./results/ADM_VRP_20_1024/data_pak_calc.csv') | |
df = csv_file[['latitude','longitude', 'demand']].head(10) | |
def create_data(graph_size, num_samples, is_save=True, filename=None, is_return=False, seed=1234): | |
"""Generate validation dataset (with SEED) and save |
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
# Web scraping from w3schools | |
from urllib.request import urlopen as get | |
from bs4 import BeautifulSoup | |
b_url = 'https://www.w3schools.com/python/' | |
n_url, s_url = 'python_intro.asp', 'python_exam.asp' | |
page_count = 0 | |
def start(base_url, next_url, stop_url): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#Read list of RSS feeds from CSV files and save outpoot in another CSV | |
import feedparser | |
import csv | |
import jsonpickle | |
writer = csv.writer(open('items.csv', 'w')) | |
reader = csv.reader(open('feeds.csv', 'r')) | |
next(reader) # column headings |
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
# -*- coding: utf-8 -*- | |
from chatterbot import ChatBot | |
from chatterbot.trainers import ListTrainer | |
import os | |
bot = ChatBot('Bot') | |
bot.set_trainer(ListTrainer) | |
for files in os.listdir('C:/Users/pkrosniak/PycharmProjects/chatbot/chatterbot-corpus-master/chatterbot_corpus/data/english/'): | |
data = open('C:/Users/pkrosniak/PycharmProjects/chatbot/chatterbot-corpus-master/chatterbot_corpus/data/english/' + files ,'r'). readlines() |
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
import tweepy | |
from time import sleep | |
from credentials import * | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
user_profile = api.user_timeline(screen_name = 'NAME', count = 1, include_rts = False) |
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
# Import Tweepy, sleep, credentials.py | |
import tweepy | |
from time import sleep | |
from credentials import * | |
# Access and authorize our Twitter credentials from credentials.py | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) |
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
import tweepy | |
import pandas as pd | |
from datetime import datetime | |
def lookup_user_list(user_id_list, api): | |
full_users = [] | |
users_count = len(user_id_list) | |
try: | |
for i in range((users_count // 100) + 1): | |
print i |
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
# Import Tweepy, sleep, credentials.py | |
import tweepy | |
from time import sleep | |
from credentials import * | |
# Access and authorize our Twitter credentials from credentials.py | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) |
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
from twitter import Twitter, OAuth, TwitterHTTPError | |
import time | |
# enter the corresponding information from your Twitter application: | |
consumer_key = '' # keep the quotes, replace this with your consumer key | |
consumer_secret = '' # keep the quotes, replace this with your consumer secret key | |
access_token_key = '' # keep the quotes, replace this with your access token | |
access_token_secret = '' # keep the quotes, replace this with your access token secret | |
t = Twitter(auth=OAuth(access_token_key, access_token_secret, |
NewerOlder