Skip to content
Advertisement

Tag: database

Perform $gte and $lt on the same field _id in MongoDB

db.comments.find({“_id” : {“$gte”: ObjectId(“6225f932a7bce76715a9f3bd”), “$lt”:ObjectId(“6225f932a7bce76715a9f3bd”)}}).sort({“created_datetime”:1}).limit(10).pretty() I am using this query which should give me the current “6225f932a7bce76715a9f3bd” doc, 4 docs inserted before this and 5 docs inserted after this. But currently when i run this query, i get null result. Where am i going wrong ?? Answer I had no other option but to seperate my queries in order to

Why Can’t I Add Azure DB Extension on Mac?

I am following this guide: https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app?tabs=bash%2Cclone&pivots=postgres-single-server After successfully completing Step 1 and Step 2, I get to Step 3: “Install the db-up extension for the Azure CLI: az extension add –name db-up” Yet, when I run this command, I receive the following output: Any ideas here? I’ve tried some of the solutions to similar errors I’ve found on Stack/GitHub, but

sqlite3.DatabaseError: malformed database schema (?)

I executed the python file in the first try & it worked. But when I included the code “IF NOT EXISTS” in the line cur.execute(“CREATE TABLE IF NOT EXISTS store (item TEXT, quantity INTEGER, price REAL)”)& cur.execute(“INSERT INTO store VALUES (‘Wine Glass,8,10.5’)”) I am getting an error. here is my code: here is the error: Answer You have an error

How to show data by day in a Plotly chart

I have a dataframe with the number of people vaccinated per day and I’m trying to put this data in a daily bar chart of Plotly, but it aggregates the data every about 13 days. I don’t want the aggregated view this way, I need it to show the bars per day. Below is a part of the dataframe and

How can I access a SQL file while using python?

Right now I’m using Microsoft SQL Community to start a database, but for some reason I can’t command the server to do something that I want, is there any to use the library sqlite3 or pyodc to print a value that I want on the console? PYTHON: SQL: Answer sqlite3 talks to SQLite databases. If you want to talk to

Fixing points as non-outliers during outlier detection in Python

I found this Scikit Learn page explaining how to use different algorithms to detect outliers: https://scikit-learn.org/stable/modules/outlier_detection.html Is it possible to set a group of instances as non-outliers so that the algorithms understand that those specific points should not be detected as outliers? Answer If you have enough so called non-outliers for training, one option is to use Novelty detection with

Advertisement