I am trying to plot simple moving averages (SMA) using Apple’s stock price. I have lines below: But the plotting isn’t successful. What did I do wrong, and how I can correct it? Answer From the code you posted, it seems as though you didn’t set the index of the dataframe after loading the da…
How do I do the positional parameter in discord.py
This is not working. I totally followed what documentation says, but the bot doesn’t repond to me when I type “!test hello” It should work like this, but mine has nothing respond to me, idk what’s wrong at all This is the original documentation https://discordpy.readthedocs.io/en/lates…
is there a rule of thumb to know if i’m modifying a value or a referenced value?
Consider the following : How am i supposed to know that modifying hull.points (or foo, a reference to hull.points) is modifying pts ? The documentation only say : The inspector in pycharm also tell me that both foo and hull.points are a ndarray and nothing in the code, documentation, inspector tell me that my…
How to correctly read specific csv column
Hey everyone my question is kinda silly but i am new to python) I am writing a python script for c# aplication and i got kinda strange issue when i work with csv document. When i open it it and work with Date column it works fine But when i try to work with another columns it throws error KeyError:
case-insensitive treeview sorting
I am using below code to sort the treeview column but it is case sensitive i.e. if the column value is [a,c,A] the sorted value will be [a,c,A]but i want it as [a,A,c] and even the number sorting is only based on first digit i.e. if [2,1,11] is the column value, the output will be [1,11,2] what i want it
How to use python -c “code here” with newlines?
The command runs the code inside the quotes successfully, both in Linux (bash) and Windows (cmd.exe). But how to pass code with newlines, with python -c? Example: both fail. Example use case: I need to send a SSH command (with paramiko) to execute a short Python code on a remote server, so I need to pass one …
Selenium click on ng-click button
I am trying to automate a website with selenium to download an excel file. I have the following HTML for the button: I have tried clicking on the button with the following find element by class: The error message I get is: I have also tried: And received the following error: I have logged in this website succ…
How to take infinite number of arguments in argparse?
I am making a Python command line tool with argparse that decodes and encodes Morse code. Here is the code: when I type more that one argument after encode or decode it returns this: How will I take more arguments and not just the first word? Answer The shell splits the input into separate strings on space, s…
How to have the possibility to call name of columns in db.session.query with 2 tables in Flask Python?
I am developing a web application with Flask, Python, SQLAlchemy, and Mysql. I have 2 tables: I need to extract all the tasksusers (from TaskUser) where the id_task is in a specific list of Task ids. For example, all the taskusers where id_task is in (1,2,3,4,5) Once I get the result, I do some stuff and use …
Python Flask Hosting on Windows 10 IIS server
I Want to Host my Python Rest API on Windows 10 IIS server. First I tried to host a sample application but can not able to that. my_app.py web.config I have tried the below tutorials but it is not working for me. https://medium.com/@rajesh.r6r/deploying-a-python-flask-rest-api-on-iis-d8d9ebf886e9 https://www.…