[Solved] I want a pandas script to line up values from one excel sheet to another based on the values in the first spreadsheet

Commented for explanation of approach. Have found two addresses where ID from sheet2 comes back onto sheet1 import io sheeta = pd.read_csv(io.StringIO(“”” house_number street suburb 0 43 Smith Street Frewville 1 45 Smith Street Frewville 2 47 Smith Street Frewville 3 49 Smith Street Frewville 4 51 Smith Street Frewville 5 53 Smith Street Frewville … Read more

[Solved] python: (calling all experts out there to help) how do i write a chatbot which can commands and execute a python function?

Well one suggestion is to use NLP Linguistic Features For ease, i will be using spacy import spacy nlp = spacy.load(‘en_core_web_md’) doc = nlp(‘Get me all sales numbers for August in the Delhi’) for token in doc: print(token.text,token.dep_,token.pos_) Output | ‘Word’ | ‘DEPENDENY’ | ‘POS’ | ———————————- |’Get’ | ‘ROOT’ | ‘AUX’ | |’me’, | … Read more

[Solved] I have given nested list accessing via for loop, but I can’t getting result?

patientsList = [[‘sagar’,’9856782311′],[‘mahsh’,’7865423158′]] search = input(“Enter mobile number of patient to search: “) for patient in patientsList: ”’ patient looks like this [‘sagar’,’9856782311′] patient[0] is the name patient[1] is the phone number ”’ if search == patient[1]: print(“Required patient is”) print(patient) print(“is Appointed”) break 9 solved I have given nested list accessing via for loop, … Read more

[Solved] Indentation within a for loop

It is only run after the nested loop. Looking at the output from the post you referenced, the program starts with 1, prints one 1 without a newline, then exits the nested loop, then prints the newline. Then it enters the nested loop with 2, loops twice (prints a 2 without a newline, then prints … Read more

[Solved] I’m not getting the else output

input returns a string, and 0 != “0” Either parse your strings immediately parx = int(input(“Write your parX: “)) pary = int(input(“Write your parY: “)) Or check against strings while pary != “0” and parx != “0”: Note too that you should be using some error checking. If the user enters a non-number, your program … Read more

[Solved] Using Python to make a quiz from a text file

First of all, use .strip() to remove the newline characters. The answers comparison might not always work because of them. To ask every even row you can use the modulo (%) operator to get the remainder of the current line index after dividing it by two. If the answer is correct we add 1 to … Read more

[Solved] Scrapy keeps getting blocked

Your xpath expressions aren’t correct. When you are using relative xpath expressions they need to start with a “./” and using class specifiers is much easier than indexing in my opinion. def parse(self, response): for row in response.xpath(‘//table[@class=”list”]//tr’): name = row.xpath(‘./td[@class=”name”]/a/text()’).get() address = row.xpath(‘./td[@class=”location”]/text()’).get() yield { ‘Name’:name, ‘Address’:address, } next_page = response.xpath(“//a[@class=”next-page”]/@href”).get() if next_page: yield … Read more