• Register

Recent questions tagged python-3

0 votes
0 answers 1 view
Problem: I want to make a python program in which it asks user to input data but if the data is invalid then it asks the user to enter again instead of crashing ?
asked 58 minutes ago Ashty 1.6k points
0 votes
1 answer 1 view
Problem: How to fix this error: module' object has no attribute HELP! I need help understanding this error: module' object has no attribute Can someone please help fix this, I am new in python().
asked 14 hours ago Mashhoodch 9.6k points
0 votes
1 answer 2 views
Problem: How to fix this error: python 3 is not recognized as an internal or external command HELP! I need help understanding this error: python 3 is not recognized as an internal or external command Can someone please help fix this, I am new in python Any anyone ideas on what I need to do to fix this? Thanks!
asked 1 day ago Mashhoodch 9.6k points
0 votes
1 answer 1 view
Problem: How to fix this erro: attributeerror: module 'enum' has no attribute 'intflag' HELP! I need help understanding this error: attributeerror: module 'enum' has no attribute 'intflag' Can someone please help fix this, I am new in python: attributeerror: module 'enum' has no attribute 'intflag' Any ideas on what I need to do to fix this? Thanks!
asked 1 day ago Mashhoodch 9.6k points
0 votes
1 answer 5 views
Problem: I have python 2 and python 3 on my system. But it always select python 2 but I want to switch it according to my needs. How can i switch in between them?
asked 5 days ago jyoti goyal 2.1k points
0 votes
1 answer 3 views
Problem: I'm aiming to write a script that will compare each line within a file, and based upon this comparison, create a new file containing the lines of text which aren't in the second file. I think I need something along the lines of this and then to compare the string[0] from each line of each file but I'm really clueless from this point. Any help me
asked 5 days ago Mashhoodch 9.6k points
0 votes
1 answer 4 views
Problem: typeerror: unicode-objects must be encoded before hashing.
asked 5 days ago Ethan ross 1.8k points
0 votes
1 answer 8 views
Problem: in my code, I have: class A: def a(): ...... def b(): a() ...... b() Then the compiler will say "NameError: global name a() is not defined." If I pull all the stuffs out of the class A, it would be no problem, but how can I define the method in class A? Thank you very much.
asked 6 days ago Mashhoodch 9.6k points
0 votes
1 answer 25 views
Problem: I want to count the number of times a word is being repeated in the review string I am reading the csv file and storing it in a python dataframe using the below line reviews = pd.read_csv("amazon_baby.csv") The code in the below lines work when I apply it to a single review. print reviews["review"][1] a = reviews["review"][1].split("disappointed") print a b = len(a) print b
asked 6 days ago Mashhoodch 9.6k points
0 votes
1 answer 14 views
Problem: I've programmed these for calculating Variance import pandas as pd import xlrd import numpy as np import matplotlib.pyplot as plt credit_card=pd.read_csv("default_of_credit_card_clients_Data.csv",skiprows=1) print(credit_card.head()) for col in credit_card: var[col]=np.var(credit_card(col)) print(var)
asked 6 days ago Mashhoodch 9.6k points
0 votes
1 answer 9 views
Problem: attributeerror: could not find pyaudio; check installation.
asked Feb 22 Dan phillip 1.9k points
0 votes
1 answer 8 views
Problem: I wrote a script to find spelling mistakes in SO questions' titles. I used it for about a month.This was working fine UPDATE This is the url causing the problem.Even though this url exists. I tried changing the range to some lower values. It works fine now. Why this happened with above url?
asked Feb 21 Mashhoodch 9.6k points
0 votes
1 answer 16 views
Problem: I am following instructions for a class homework assignment and I am supposed to look up the top 200 most frequently used words in a text file. Here's the last part of the code: fdist1 = FreqDist(NSmyText) vocab=fdist1.keys() vocab[:200] But when I ... 1, in <module> TypeError: 'dict_keys' object is not subscriptable Any suggestions on how to fix this so it can correctly return an answer?
asked Feb 21 Mashhoodch 9.6k points
0 votes
1 answer 86 views
Problem: when I make a function call to this method create({'1','2'}) I get an TypeError: 'set' object is not subscriptable error on line 'AWS': list(map(lambda id: f"arn:aws:iam::{id}:root", ids[i:i + 200])). Coming from a java background, is this somehow related to typecasting? Does the error mean that I'm passing a set data structure to a list function? How could can this be resovled?
asked Feb 19 Mashhoodch 9.6k points
0 votes
1 answer 16 views
Problem: typeerror: '_io.textiowrapper' object is not subscriptable.
asked Feb 19 Dan phillip 1.9k points
0 votes
1 answer 17 views
Problem: attributeerror: 'series' object has no attribute 'reshape'
asked Feb 18 charles mathews 3.8k points
0 votes
1 answer 12 views
Problem: I have tried import urllib.request or import urllib The path for my urllib is /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/__init__.py I am wondering where is urlopen, or is my python module pointing to the wrong file?
asked Feb 18 Mashhoodch 9.6k points
0 votes
1 answer 11 views
Problem: I am novice to Python and following a tutorial. There is an example of list in the tutorial : example = list('easyhoss') Now, In tutorial, example= ['e','a',...,'s']. But in my case I am getting following error: >>> example = list('easyhoss') ... , line 1, in <module> TypeError: 'list' object is not callable Please tell me where I am wrong. I searched SO this but it is different.
asked Feb 18 Mashhoodch 9.6k points
0 votes
1 answer 10 views
Probelm: parent module '' not loaded, cannot perform relative import.
asked Feb 17 charles mathews 3.8k points
0 votes
1 answer 19 views
Problem: fatal error in launcher: unable to create process using '"'
asked Feb 17 charles mathews 3.8k points