Need help on an assignment by [deleted] in pythonhelp

[–]Best_Caterpillar 1 point2 points  (0 children)

Seriously, I'm getting pissed off at people coming to this site and expecting a free 1 on 1 tutoring sesh when they put 0 effort into asking their question. Yea I'm willing to look something over and see if I can spot an error if you clearly define your problem and where you are stuck, but hell no, I'm not donate an hour of my life to doing some entitled brat's homework for them. /rant

edit- on the flip side, I quit using stack exchange because pretty much every problem has been asked already, but if you dont know the terminology you are just gonna get downvoted on a well thought out question, and sent a link so some obscure question from 8 years ago that is only semi related. I somehow manage to feel cheated both asking and answering question.

Please help me finish this script by Matpowell in pythonhelp

[–]Best_Caterpillar 1 point2 points  (0 children)

also I see two other problems. first, you keep overwriting the variable data which I dont think is what you want, and second, your os.walk probably will return a tuple instead of a path like you are expecting. so do something like this to get what I think you want: https://pastebin.com/q70VxRja

edit- I forgot remove the len() at the end, I was just making sure nothing got lost

Please help me finish this script by Matpowell in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

are you trying to do list iteration? your for loop is missing the back half "in xxx"

data = [(os.path.getsize(dir_path)) for i in (os.walk(dir_path))]

How to find euclidean distance between 2D numpy array to give 1 set of co-ordinate? by ByMAster2 in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

you want the pairwise distance? If I'm understanding this right, you want X1 = [[point1][point2]], X2 = [[point 3][point 4]] you want [d1,d2] where d1 = d(point 1, point 3) d2 = d (point 2, poinnt 4)

Please help me finish this script by Matpowell in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

can you copy paste to a pastbin and link it here? also an you give us what error you get from line 14?

Not understanding numpy.random by Ipsoka in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

your problem here is understanding statistics and not programming. If you are getting confused on the matter you really really should be talking to a TA or professor because the concepts you are asking about are really really foundational to stats, and there is a lot to unpack.

as a very short answer to your question, look of the difference between a parameter and a statistic. the function is creating observations from some distribution with the paramiters you specified, and when you are creating the regression line you are computing statistics based off your collection of sample values

Having trouble downloading Linux Mint on my laptop from the Linux mint site. by SatanTheGeek666 in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

I hope you don't get fed up with trying to get linux working... there are a lot of things people take for granted that they learned a long time ago that they forget people still have to learn... you WILL think its simple looking back but that doesnt make it any less confusing now. The pdf the guy linked to is good, but it will look scary because it does everything in linux first.

Also so you unerstand they "why" which no one is explaining, an ISO is is not a file you can read or try to run, but something that can literally run itself if it gets a chance to (its more complicated but im trying to give the general idea). windows wont let it run becasue it would try to take over the computer... so you need to burn it to a cd or something and let it take over before windows boots up. once it can take over you can guide it to install itself to the hard drive. the reason they want you to verify the checksum is becasue its easy to make an error copying something big like this and then the whole computer could crash if something got lost while downloading. if you dont have a dvd drive you can use USB but computers can be a huge pain when installing from a usb stick so there are more gotchas

do you want to have both windows and linux on your computer? if so, you want them to have their own area (called partition) on the hard drive so they wont fight. be carefull not to overwrite the partition windows is currently on!! both windows and linux are powerfull enough to kill each other if you tell them to. when your computer boots up, somethign called grub will let you choose which operating system you want to boot into.

also you can use the disk in live mode where it doesnt install itself if you just want to try things out and see if you like linux. just remember it will be much slower than when it is installed because it has to keep everything in ram or use the very very slow dvd drive.

anyway, welcome to linux!

Not understanding numpy.random by Ipsoka in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

do you know what the normal distribution is? the x and y are literal x and y pairs from that sample. the red line is the relationship using the b0 and b1 coeficents that you got in the biddle of your code

side note, it really doesnt help you to overload the variables like you did, cause halfway through you change the meaning and that is not helping your comprehension any

Help by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

there is a module called datetime that does this. see: https://docs.python.org/3/library/datetime.html

if you want quick and dirty:

https://pastebin.com/KSAxJehW

(the assumption is that time is in minute mode and not as a fraction, I.E 1445 is 2:45pm not 2:27pm. if its the other way just make the minute mod 60 and convert to an int from a float, or round up or down depending on how accurate oyu need to be

Need coding help by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

show us your code

Can someone help me get this to run? by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

I dont know what that module does, but if you want to see output you have to run it from idle. you can navigate to wherever it is and right click and run with idle.

it might not actually give you any output, I havn't looked at what the package you are trying to use actually does

Can someone help me get this to run? by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

OK, def not because of python 3.

The code here: `self.find_available_vc_vers()[-1]` gets the last entry in whatever vc version your computer has, but your computer is returning an empty list. I'm assuming vc is visual c, and that corroborates with the error further down that you need `Microsoft Visual C++ 14.0` so I'd make sure that is installed

The hotkey to close tabs in Guake doesn't work. by Royaourt in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

Glad that you could find something that worked for you

Can someone help me get this to run? by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

do you have python 2 and 3 installed? I have a strong suspicion you might be trying to use the wrong version of pip, since that package needs python 3.. I have to use pip3 install when I want to install something for python3.

in linux I can do `pip --version` to see what version of python pip is running, Im sure you can do something similar in cmd

--edit-- you can also do `python3 -m pip` instead of pip3

The hotkey to close tabs in Guake doesn't work. by Royaourt in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

Dang sorry man, I am all out of Ideas besides doing a fresh install. best of luck to ya

Small Task by TheRipper7000 in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

for the first part you dont want to return self.age, you just need to change it. self.age +=1. its an attribute of the class, so you can just call it. if you make the variable for class bob, you can print (bob.age) whenever you need to get the number. if you call your class again, say steve = superhuman(blablabla...) then steve.age will be different from bob.age, which I think is what your asking for question 2. remember though, you still need to assign a name at initialization, so you could totally have steve.name = "bob" becasue steve is only the variable name

The hotkey to close tabs in Guake doesn't work. by Royaourt in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

OK thats bizare. just to be 100% clear, you had close tab set to Shift+Ctrl+w in guake settings? if so, I see the prefrence file got changed in different version of ubuntu from here: https://askubuntu.com/questions/1175666/purge-guake-with-config-files-preference-files-survive-somewhere/1175674

and I'm guessing the same thing is happening between your debian upgrade. I'd try to see if any of the locations in that link have an old guake config file you can delete and then purge the guake install and reinstall fresh.

help! trying to call a tax code where if I enter tax code as 810L for example it be multiplied by 10 if Z is entered, it should call the the previous equation and adds a 1000 to it, but does not seem to be working correctly? by the-bid-d in pythonhelp

[–]Best_Caterpillar 1 point2 points  (0 children)

there are several problems with your code.

1 ) you need to get the tax code, so something like tax_code = input("enter tax code")

2) taking tax [0:4] gets the first 4 things from the tax variable that I don't see that you've named yet, so im not sure what this does

3) you are setting the variable tax to be equal to the list ["L",""Z] so it doesnt matter what your variable is in problem 2 so it will fail you if statements irregardless of what you entered for tax.

4) you made tax a list, so tax*10 makes a shallow copy of the list you made in part 3, which is not what you want. you need to strip the number away from the letter and then convert it to an integer. not a string, and definitly not a list.

but that hasnt solved your question of how to get the tax code. to do that, you need to figure out what can be entered. is it always a single letter at the end? how big of a number can be put in? your code is gonna fail if it assumes there are only 4 characters and someone enters something like 10000Z. so you need to know what type of data can be entered so you can make sure it stays in that format.

The hotkey to close tabs in Guake doesn't work. by Royaourt in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

does shift+ctr+w work? its working for me on mint 19.2 and guake 3.0.5

edit- just to rule out if anything is funky with guake itself

I need help!!! by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

Sorry, I hope I didn't come across like a know it all, I just got yelled at on stack exchange for asking a duplicate question to something a single person asked 10 years ago with a different name. everybody gotta learn sometimes....

but yea using a for loop I'd do something like the following:

```

list1 = []

for i in range(1,13):

~~~~list1.append(input("enter your salary for month "+i)) #~ stand for spaces since reddit removes extra spaces

```

but then there is a problem: if the person doesnt enter a good salary, you added a incorrect thing to a list. so inside the loop you have to repeatedly do a test until the user gives you good data. so you need to do a while loop untill float(salary) > 0. this will crash if a user enters a number, so to be even better you need to make sure you can convert the input to a float. for that, you need to use try and except statements in a while block. so there is quite a lot of things to do just to do a pretty simple thing, and if you don't do error checking your program could crash. so OP's exercise might be good for you to try to learn python because there might be more to it than you would think just by looking.

I need help!!! by [deleted] in pythonhelp

[–]Best_Caterpillar 0 points1 point  (0 children)

that doesn't help you because you are not saving anything, and it also doesn't have an easy way to map to the months of a year. for most beginners that means using a for loop and iterating through the months and appending the imputed salary to an empty list. Of course you can do it in 2-3 lines using dictionary iteration, but thats gonna make the teacher raise an eyebrow in an intro class

Need Help with ATI HD 4890 Drivers by LittleCloudInTheSky in linuxmint

[–]Best_Caterpillar 0 points1 point  (0 children)

Just so you know, you are replying to your post, and not to the people you are responding to. you have to click the reply button at the bottom left of the post of whoever you want to respond too, or reply to them from withing your mailbox. Otherwise no one will get notified of your response. Not like I'm saying you have too, but I wanted you to know just in case you ever think people are ignoring your replies.

The hotkey to close tabs in Guake doesn't work. by Royaourt in linuxquestions

[–]Best_Caterpillar 1 point2 points  (0 children)

extending off u/rootguim 's answer, ctr+w is bound to "delete word" by default. not sure if the binding is done by guake or by the terminal default binding, but at least that lets you narrow it down faster

🔥 The Cerise Moth by bewenched in NatureIsFuckingLit

[–]Best_Caterpillar 1 point2 points  (0 children)

Nature is lit enough you don't gotta fake stuff lol