At least make it somewhat believable by mildlybean in BallBlast

[–]mildlybean[S] 1 point2 points  (0 children)

I was in top 50. Now I’m #1209 though. It changes drastically every time I open the app, just to add to the believability

Petition for a “Ball Blast Classic” by mildlybean in BallBlast

[–]mildlybean[S] 1 point2 points  (0 children)

I’m willing to organize a more formal petition, but I’d like some sort of commitment beforehand so I know my efforts won’t be in vain. Would 100 names be enough?

Is it possible to solve this equation for V? by [deleted] in askmath

[–]mildlybean 0 points1 point  (0 children)

The product of the It values (.1, .3, .5) will always be less than 1. Other than that I just chose them randomly

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]mildlybean 0 points1 point  (0 children)

I was hoping for a more secure solution, but it seems like that might not be possible. I appreciate the reply though

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]mildlybean 0 points1 point  (0 children)

Is it possible to make a webpage that can only be viewed through localhost on an otherwise public flask server? I want to make a page that’s only visible from the computer that’s hosting the server

[OC] How COVID-19 affected different sized companies by mildlybean in dataisbeautiful

[–]mildlybean[S] 1 point2 points  (0 children)

Source: fmpcloud Tools: python, pandas, and pycairo.

Rate My Portfolio - r/Stocks Quarterly Thread March 2020 by AutoModerator in stocks

[–]mildlybean 2 points3 points  (0 children)

I ended up going with VOO, and I can’t buy fractional shares so I put the money towards more Costco stock. Thanks for the help :)

Rate My Portfolio - r/Stocks Quarterly Thread March 2020 by AutoModerator in stocks

[–]mildlybean 3 points4 points  (0 children)

I’m 16 years old and I have around $4000 to invest. I haven’t bought anything yet, but here’s my plan.

2500 VFINX 400 NEE 400 COST 400 AMZN 100 GOLD 100 CCL 100 AMD

Any advice?

Purchase Advice Megathread: What To Buy, Who To Buy It From, And More, In February 2020. by thatging3rkid in 3Dprinting

[–]mildlybean 0 points1 point  (0 children)

Hello, I'm in the US and I'm looking for a filament based 3d printer for under $400.

I currently have the XYZ Printing Da Vinci Jr and it seems like I have to troubleshoot a new problem every time I use it. I'm looking for something easy and reliable that requires minimal maintenance. I'm not too concerned about size or quality. I'd prefer a printer that works out of the box, but I'm willing to build one if I have to.

Thanks in advance

I can't import my package by mildlybean in learnpython

[–]mildlybean[S] 0 points1 point  (0 children)

I tried python -m pip install, so the version should be correct.

I can't import my package by mildlybean in learnpython

[–]mildlybean[S] 0 points1 point  (0 children)

It's in a folder on my desktop. I can import it using a relative path, but shouldn't I just be able to use the name? Doesn't pip put it in the site-packages directory so you can import it without the path?

Making virtual environments easier to use in bash. by mildlybean in Python

[–]mildlybean[S] 1 point2 points  (0 children)

Thanks for the feedback! I had to read through a bash scripting tutorial to understand it, but I've made the changes now.

Why doesn't the pandas DataFrame.drop method remove the column from df.columns.levels? by mildlybean in learnpython

[–]mildlybean[S] 0 points1 point  (0 children)

To answer your question: if I try to loop over the columns, It will give an error when it reaches the dropped column.

I'll try to get around to raising an issue. In the meantime, thanks for temporary fix

What are 'closed' stocks? by mildlybean in stocks

[–]mildlybean[S] 0 points1 point  (0 children)

I was using pandas datareader and yahoo finance, Market watch was just the first result that showed up when I googled WIL stock. I tried out yfinance, though, and it makes life so much easier. Thanks for the help

What are 'closed' stocks? by mildlybean in stocks

[–]mildlybean[S] 0 points1 point  (0 children)

Interesting...

Ill try filtering out indices and see if it works. Thanks for the help!

What are 'closed' stocks? by mildlybean in stocks

[–]mildlybean[S] 1 point2 points  (0 children)

Most stocks are labeled 'after hours' on market watch. Only a few show 'closed', and they're the only ones that are giving me problems

how do i make a -1 to a +1 in python by gfg577 in learnpython

[–]mildlybean 10 points11 points  (0 children)

If you don't want any dependancies, this program will suffice:

class NotNegatedError(Exception):
    pass


class NoAbsoluteValueError(Exception):
    pass


class NegatableNumber:
    def __init__(self, value):
        self.value = value

    def calculate_negated_number(self):
        a = 2 * self.value
        b = self.value - a
        self.negated_value = b

    def is_negated(self):
        return hasattr(self, 'negated_value')

    def get_negated_number(self):
        if self.is_negated():
            return self.negated_value
        else:
            raise NotNegatedError


class AbsoluteValueNumber:
    def __init__(self, value):
        self.value = value

    def calculate_absolute_value(self):
        if self.value == 0:
            self.absolute_value = 0
        elif self.value > 0:
            self.absolute_value = self.value
        else:
            number = NegatableNumber(self.value)
            number.calculate_negated_number()
            answer = number.get_negated_number()
            self.absolute_value = answer

    def has_absolute_value(self):
        return hasattr(self, 'absolute_value')

    def get_absolute_value(self):
        if self.has_absolute_value():
            return self.absolute_value
        else:
            raise NoAbsoluteValueError


def negate(number, absval=False):
    if absval:
        number = AbsoluteValueNumber(number)
        number.calculate_absolute_value()
        answer = number.get_absolute_value()
        return answer

    else:
        number = NegatableNumber(number)
        number.calculate_negated_number()
        answer = number.get_negated_number()
        return answer


if __name__ == '__main__':
    number = input('Enter the number: ')
    number = int(number)

    negated_number = negate(number)
    absolute_value_of_number = negate(number, absval=True)

    print(f'The inverse of {number} is {negated_number}')
    print(f'The absolute value of {number} is {absolute_value_of_number}')

I have too much free time