Category "indexing"

How to use like query on FullText Index Column

I have this user table structure. `users` ( `id` bigint(20), `balance` bigint(20), `current_parent` bigint(20), `parents` varchar(45

SQL Indexing not improving speed

Given an SQL database with index for (startpage, endpage), with a relation Articles(*ID*, title, startpage, endpage), why isn't a query SELECT title FROM Artic

Extract indices of certain values from a list in python

Suppose, I have a list [0.5,1,1.5,2,2.5,3,3.5,4,4.5], now I would like to extract the indices of a list [1.5,2.5,3.5,4.5], which is a subset of that list.

Reindex Pandas Series case insensitive (Combining matches)

I have a pandas series with string indices and integer values: (My actual series has >1000 entries) Count apple 1 bear 2 cat 3 Apple 10 pig 20 Cat 30 ApPl

Database Indexing

I'm trying to figure out on how to create an Index for below query such that the SELECT statement only traverse the leaf level of the index horizontally and it

In DB MySQL the index already exists for the column, should I add the index in the Hibernate Entity?

If the column has already the index "INDEX_VALUE" in DB MySQL. Do I still need to add in hiberante Entity? @NamedQuery(name = "", query = "SELECT e FROM Entity

Dataframe add new row if the index does not exist like a dictionary without checking existence

import pandas as pd a = [['a', 1, 2, 3], ['b', 4, 5, 6], ['c', 7, 8, 9]] df = pd.DataFrame(a, columns=['alpha', 'one', 'two', 'three']) df.set_index(['alpha'],

Assigning to a double-indexed numpy array

I know that when assigning to a double indexed-array gives bad results because you're assigning to a view rather then to an array directly, but I cannot figure

Indexing dataframe within a loop

I'ld like to extract specific data from a log-data. In R it looks like that Data Frame I need values from Data$Time of the cases, where Data$Data_Type == "DATA"

Sequence with stopping values

This is like a regular tribonacci sequence, however, I want the sequence to stop whenever the term is at the min or max value. This is what I have started seque

PostgreSQL first query slow

I implemented cursor pagination. And for first rows it works realy well but the more I scroll down, the first query I send is slower. I run this query: SELECT *

Any efficient analogue of argsort for array of indices with NumPy?

I have an array of indices like a = [2, 4, 1, 0, 3] and I want to transform it into np.argsort(a) = [3, 2, 0, 4, 1]. The problem is that argsort has O(n*log(n))

How does mongodb decide which index to use for a query?

When a certain query is done on a mongodb collection, if there are multiple indexes that can be used to perform the query, how does mongodb choose the index for

What is the best way in numpy to use a vector of positions as indexes in a an nd array?

I have a numpy array of agents positions: positions = np.array([[row_0, col_0], [row_1, col_1], [row_2, col_2]]) I

Pyspark: Extract Json Objects from Array

I need to extract objects from an array, where there's more than one object in that array I need to repeat for every id and if the field is null then I want to

Retrieve name of column from its Index in Pandas

I have a pandas dataframe and a numpy array of values of that dataframe. I have the index of a specific column and I already have the row index of an important

how to modify already defined composite key in liquibase

I need to alter a table to modify the order of the indexes created from the composite key for the below mentioned changeset. <changeSet author="demo (generat

Is there a more efficient way to find index of an element without using list built-in functions?

We can get the index of an element in a list using the .index() function. I was wondering if there's any more efficient way to find the index without using the

Postgres array_position(array, element) sometimes 0-indexed?

Postgres method array_position(array, element), like other things in SQL, is 1-based. For example: SELECT array_position(array[4,5,6], 5) -- returns 2 But,

What's the computational complexity of .iloc[] in pandas dataframes?

I'm trying to understand what's the execution complexity of the iloc function in pandas. I read the following Stack Exchange thread (Pandas DataFrame search is