I am trying to read 5 columns from a 6 column csv data and use each row in a formula and itarete for all the rows. the file is csv file is something like this with hunderds of rows when I put values by hand it works all in well. However, when I put the df columns to do it
Tag: python
POST on MYSQL database done in terminal but nothing in my base
I would like to know why all seems to be okay but nothing is insert in my mysql database ? I get some data from an api and I would like to insert data in table. Using flask, python, pymysql Thanks in advance traceback Answer Assuming that the INSERT statement looked good at that debugging print function, then…
How to convert a bytearray in a tuple in a list to a string?
I am trying to fetch data from my mysql database using python: This reads a column in my database called binaryValue, where every row is either a “0” or a “1” When I print out the variable “myresult”, it gives me a list where each item is a tuple: I need to get a string wit…
Pass list of object to HTML page for looping and display data as list of object
I’m trying to pass the list of object to HTML for looping to render the data fetch from MongoDB Approach tried: Created a global variable as list of object. Fetched the data from the MongoDB and set the data to global variable And tried to fetch it directly but this is not accessible means no error and …
how to make a currency search filter?
When w = {“q”: “25”} is used, it returns the entire currency table, only the dollar exchange rate should be issued Answer So, just to filter by a particular country code, you can filter the json after it is returned.
cannot load pickle files for xgboost images of version > 1.2-2 in sagemaker – UnpicklingError
I can train a XGBoost model using Sagemaker images like so: This work for all versions 1.2-2, 1.3-1 and 1.5-1. Unfortunately the following code only works for version 1.2-2: Otherwise I get a: Am I missing something? Is my “pickle loading code wrong”? The version of xgboost is 1.6.0 where I run th…
How can I format multiple thousands of date-dependant data points in a readable graph with Matplotlib?
I have two corresponding lists, one of the dates and another of its respective price. The lists are 30,000 data points long. I’m using this code to generate the graph below: I’m supposed to have the dates separated in a readable format using the code above but it doesn’t seem to work. I̵…
How to deal with “ValueError: array must not contain infs or NaNs” while running regressions in python
I have a df with growth variables and often some initial values are 0, in which case it produces infinite values when the value moves from zero to non-zeros. i.e. when i run PanelOLS, i get an error message Is there a way to ignore these entries to continue with the regression without having to drop them and …
ModuleNotFoundError: No module named ‘django.core’
I want to create django project so I’ve configured virtualenv ,and I installed django pipenv install django==4.0.1 when I create app using this command python3 manage.py startapp Accounts I got this error. can any one help to solve this problem ? Answer Instead of python3 manage.py startapp Accounts try…
How can I get automatical features with dfs, using featuretools, when I have only one dataframe?
I am trying to figure out how Featuretools works and I am testing it on the Housing Prices dataset on Kaggle. Because the dataset is huge, I’ll work here with only a set of it. The dataframe is: I set de dataframe properties: Then call the dfs method: I get the following warning: UnusedPrimitiveWarning:…