Skip to content
Advertisement

Tag: python-3.x

How to read a day and time on the same line?

I was trying to reproduce the following entry in Python: 05 08:12:23. I did it as follows: Notice how there is a space after day and the split () I put to separate the numbers with ‘:’. How would I go about reading the day on the same input? Is there a better way to do this than what I’m

Develop a module to help generate lottery tickets in python

I have made the two modules (which are incomplete I guess) for the main function but couldn’t make the main function Create a script file named lottohelper_using_getopt.py for the module in your current workspace/directory. Define a function named lotto649 (in the script/module file) which can generate and return six different random integers in a list from range [1,49]. (1 point)

how to get dates from yahoo finance

I have a problem with getting the dates from yfinance into my matplotlib graph can somebody help/show me how to get the dates from yfinance into my matplotlib graph Answer Tested ✅ 🔰You could extract the date from ticker_history[observation] 🔰 It is a Pandas Series object, so here’s how I’d do it:

Replacing values using dictionary

What are the reasons why are regex replacment doesn’t work? I have tried ensuring no excess spaces. When I do df.loc[df[‘column’]==”and another reason with her”] nothing has changed. Answer Please use df.replace(regex=dict)

Import Error: can’t import name gcd from fractions

I’m trying to import a function called gcd from a module called fractions with from fractions import gcd. For some reason, PyCharm throws an ImportError: I had this working before, what am I doing wrong? Answer Your traceback says Python 3.9 and the documentation says gcd is a function in math Changed in version 3.9: The math.gcd() function is now

Advertisement