[Tutor] How would I replace the data of a Pandas Series with the values of a dictionary?

2019-07-16 Thread Daniel Bosah
Hi all, I have a problem trying to match items in a dict and pandas series in Python. I have a dict ( called city_dict )of cities and city_id's ; for each city ( which is a key in the dict ), a unique city_id is a value in that dict. So for example, city_dict = { New York : 1001, LA : 1002, Chic

[Tutor] Parsing and collecting keywords from a webpage

2018-06-20 Thread Daniel Bosah
# coding: latin-1 from bs4 import BeautifulSoup from urllib.request import urlopen import re #new point to add... make rest of function then compare a list of monuments notaries ( such as blvd, road, street, etc.) to a list of words containing them. if contained, pass into new set ( ref notes in c

[Tutor] Recursion depth exceeded in python web crawler

2018-06-14 Thread Daniel Bosah
I am trying to modify code from a web crawler to scrape for keywords from certain websites. However, Im trying to run the web crawler before I modify it, and I'm running into issues. When I ran this code - *import threading* *from Queue import Queue* *from spider import Spider* *from domain i

[Tutor] Figuring out selective actions in Python

2018-05-05 Thread Daniel Bosah
Hello, I'm trying to figure out how to do blank in blank things. For example, if I want to delete 5 MB ( or anything ) for every 20 MB, how would the could look like? I'm essentially trying to do an action in one order of the sequence out of an entire sequence. Thank you for your help __

[Tutor] Matplotlib scatterplot help

2018-04-30 Thread Daniel Bosah
I have a function in which returns scatterplot of a Isomap function, which takes output from a TF-IDF function, which calculated TF-IDF values of certain articles online. I used four articles and I want to show the

[Tutor] How to Load Every Revised Wikipedia Page Revision

2018-02-19 Thread Daniel Bosah
Good day, I'm doing research for a compsci group. I have a script that is supposed to load every revised page of a wikipedia article on FDR. This script is supposed to, in while loop access the wikipedia api and using the request library, access the api if the continue is in the requests update

[Tutor] How to get all previous revision entries of a wikipedia page?

2018-02-16 Thread Daniel Bosah
Hello, I'm doing research for a compsci group. I'm new at Python, and my task is the use the Wikipedia API to get all the previous revision entries of a Wikipedia page and collect them in one list. Now, I'm totally lost on how to do this. I have never used a API before, and I'm not sure how to us

[Tutor] Data Structures printing and Python Package creation

2018-02-03 Thread Daniel Bosah
I'm in a research group for school, and my first task is to learn how to make a Python package and to learn how to print out all types of data structures. Are there resources I can be pointed to to help me out. Thanks ___ Tutor maillist - Tutor@python.

[Tutor] Python Daemons

2017-08-01 Thread Daniel Bosah
I'm following an online tutorial about threading. This is the code I've used so far: import socket import threading from queue import Queue print_lock = threading.Lock() target = 'pythonprogramming.net' def portscan(port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try:

[Tutor] PYTZ Package not working.

2017-07-20 Thread Daniel Bosah
I'm trying to get my function to work: def deposit(self,amount): if amount > 0: self.balance += amount self.show_balance() self.transaction_list.append((pytz.utc.localize(datetime.datetime.utcnow()),amount)) # appends traction details to list def

[Tutor] Problems with pytz module

2017-07-19 Thread Daniel Bosah
I'm learning about OOP programming in Python. This is my code from my online course. import datetime import pytz class Account: """Simple account class with balance""" def __init__(self,name,balance): self.name = name self.balance = balance self.transaction_

[Tutor] Sklearn

2017-03-10 Thread Daniel Bosah
Can someone explain sklearns to me? I'm a novice at Python, and I would like to use machine learning in my coding. But aren't there libraries like matplotlib I can already use? Why use sklearns? ___ Tutor maillist - Tutor@python.org To unsubscribe or ch