Questions tagged [indexing]
Indexing data structures is a general technique to improve the speed of data lookups.
33,284
questions
0
votes
3
answers
48
views
python index [-1] shows wrong element
As I learned, in python index -1 is the last number. for instant in:
values = [1, 2 , 3, 4, 5, 6, 7, 8, 9, 10]
print(value[-1])
returns 10 in output.
Now, if I want to insert a number in the last ...
1
vote
1
answer
16
views
return the index of childnode when clicked
Here, I have parent div of class = "alphabets" and have child div's all with same class = "word"
<div class="alphabets">
<div class="word"> abc &...
0
votes
0
answers
25
views
Why using inner join itself is more faster than where
Here is my table:
CREATE TABLE `cerp_oms_order` (
`id` bigint NOT NULL,
`company_id` bigint NOT NULL,
`order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`source_type` ...
1
vote
1
answer
29
views
Get response of google indexing api in codeigniter
I am trying to setup google indexing api in codeigniter, I have done all steps on google cloud and search console part.
It works, but returning success message on all options event when url is not ...
1
vote
1
answer
26
views
Pandas .iloc indexing coupled with boolean indexing in a Dataframe
I looked into existing threads regarding indexing, none of said threads address the present use case.
I would like to alter specific values in a DataFrame based on their position therein, ie., I'd ...
0
votes
0
answers
31
views
What is the best index for a "last modified by user" query
I have a Django query like
Posts.objects.filter(user=user).order_by('-last_modified')
What is the best type of index to support this query? I see two options:
Index(fields=['user_id', '-...
-1
votes
0
answers
29
views
Laravel query optimization by date with indexes
I'm using date search in query. However, size of table (over 5 million records) isn't optimal for this query. I've set up indexes on used fields, e.g.
log_timestamp_index for timestamp and action_id
...
0
votes
1
answer
15
views
How to index values in Tensorflow based on a Tensor?
I have three tensors given below in tensorflow v1:
mod_labels = [0,1,1,0,0]
feats = [[1,2,1], [3,2,6], [1,1,1], [9,8,4], [5,4,8]]
labels = [1,53,12,89,54]
I want to create four new tensors based on ...
0
votes
0
answers
10
views
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of ‘Index’
import yfinance as yf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
ticker = [“ZIM”,“ANDE”,“ARKK” ]
stocks = yf.download(ticker, start = “2010-01-01”, end = “2023-01-01”)
ANDE
...
0
votes
0
answers
9
views
compare two data frames using compare, result index should not be numbers. It should be unique value present in the data frame(particular column)
final_output = data_to_compare_1.compare(data_to_compare_2,align_axis=0).rename(index={"self":"old_extract","other":"new_extract"})
I compared two data frames ...
1
vote
0
answers
38
views
Why does the OSPG.dat file grows so much more than all other files?
Dear Jena Community,
I'm running Jena Fuseki Version 4.4.0 as a container on an OpenShift Cluster.
OS Version Info (cat /etc/os-release):
NAME="Red Hat Enterprise Linux"
VERSION="8.5 (...
-1
votes
1
answer
71
views
Slow insert into clustered index [closed]
Edit: added more info
DBMS: SQLServer 2019
I noticed that the query takes around 3.5 seconds to complete. But if I run it again it takes only 30 ms.
If I change the values it goes up again to ~3 ...
0
votes
0
answers
25
views
could not find function "seqfunc" in R. defined a sub function and want to use it for output
I have written this code to know.
(a) Develop and implement an algorithm counting the number of runs of length k in a 0-1 sequence
of length n. Read carefully: you are to count sequences of k ...
0
votes
0
answers
27
views
NxM matrix using letters and numbers
I am currently making a parking lot and would like to make a NxM matrix using letters and numbers as index for specifying the parking slots. Using strings I want it to look like:
[A1, A2,....... AN]
[...
0
votes
0
answers
20
views
Elastic Search single index vs multiple index
I want to insert nested Structure in Elastic Search.
For Example :
[
{ "Product" : "P1",
"Desc" : "productDesc",
...
1
vote
1
answer
24
views
How do you fill a dataframe index in a sequential fashion?
I have the following dataframe, df:
Date Number
2022-01-01 1
2022-01-08 2
2022-01-15 5
I wish to have the following, where "Date" is the index column how to add rows which ...
0
votes
2
answers
25
views
Getting complimentary index ranges given list of start and stop indices in Python
Imagine you have an absolute range that goes from 1 through 120. Let's also say you have a list of start, stops to indicate ranges. For example, the list [1,10] means it includes the following:
1,2,3,...
0
votes
1
answer
35
views
Accessing a value from Dask using .loc
For the life of me, I cant figure how to combine these two dataframes. I am using the newest most updated versions of all softwares, including Python, Pandas and Dask.
#pandasframe has 10k rows and 3 ...
-1
votes
0
answers
15
views
The operation failed because an index or statistics with name {Index name }already exists on table
When Running the below script to create indexes on Table from another it fails trying to re-create the same index. Error "The operation failed because an index or statistics with already exists ...
1
vote
1
answer
46
views
Select non-consecutive row and column indices from 2d numpy array
I have an array a
a = np.arange(5*5).reshape(5,5)
array([[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19],
[20, 21, 22, 23, 24]])
...
1
vote
1
answer
42
views
Indexing for SQL table which uses multiple combination of set of columns in where clause
I have a Azure SQL table which is only loaded once (no update/insert/delete) and thereafter it will be used in report. The report has multiple sql queries written on this table and the queries are ...
0
votes
0
answers
19
views
Index column width setting
I am having trouble finding settings for first column with index. How can i set width of this col?
setting width to index column
-1
votes
0
answers
16
views
Continue statment is not work only 3 index is remove remaining index should be shown?
Continue statment is not work only 3 index is remove remaining index should be shown?
<?php
$i = 0;
$names = array("Seb", "Ginna", "Shane", "Guy", "...
0
votes
0
answers
45
views
Why does SQL Server use INDEX SPOOL when there is already a relevant index during FK check?
I've got two tables in SQL SERVER 2019: Condition table with 2 FK on Reference table. Condition table has appropriate indexes on FK columns. The schema screenshot and SQL script to generate it are ...
0
votes
2
answers
39
views
how to pass a value to the bitfield
I don't know how to pass a value to the bitfield:
in header file I have the struct definition below:
typedef struct { boolean Error; } Struct_A_T;
Struct_A_T Struct_A = {0U};
boolean WriteValue;
...
0
votes
1
answer
40
views
How to turn set items into indexes for an array
I am currently trying to solve an exercise in CS50 AI, where I am supposed to create a tictactoe using a minimax algorithm. While doing this, I have to also create a function that generates possible ...
0
votes
1
answer
19
views
Removing the Indexed Column when Merging 2 Excel Spreadsheets into a new Sheet in an existing Excel Spreadsheet using Pandas
I wanted to automate comparing two excel spreadsheets and updating old data (call this spreadsheet Old_Data.xlsx) with new data (from a different excel document; called New_Data.xlsx) and placing the ...
0
votes
1
answer
15
views
Converting elements of 2D Tensor based on element mapping between old and new values?
I have a 2D tensor that contains the indices into some other tensor.
old = torch.Tensor([
[1, 2, 12, 12],
[0, 1, 12, 12],
[3, 5, 12, 12],
[7, 8, 12, 12],
[6, 7, 12, 12],
[9, 11,...
-2
votes
0
answers
15
views
Loop commands to perform same functions over different columns
I have a large data set here that I need to calculate max, min, mean, std, 10% and 90% over several columns starting from 7 - 26. What commands do I need to use in order to loop this to read a range, ...
0
votes
1
answer
36
views
Postgres search much slower using combined index for just the first item
I have two indexes showing very different results for similar searches, and I don't know why this is:
# The two indexes
"index_buyer_suppliers_on_buyer_id" btree (buyer_id)
"...
0
votes
1
answer
25
views
How to use an index when using jsonb_array_elements in Postgres
I have the next table structure:
create table public.listings (id varchar(255) not null, data jsonb not null);
And the next indexes:
create index listings_data_index on public.listings using gin(data ...
-1
votes
2
answers
43
views
With same table structure there is different behavior of query plan on different environments
Case Inputs
Mysql Version on both Prod and test: 5.7
Query:
SELECT
t1.id
t1.accountId,
t2.col1
FROM
table1 t1
INNER JOIN table2 t2 ON
(t2.Id = t1.id)
WHERE
1 AND MOD(t1.id, ...
0
votes
0
answers
19
views
Loop keeps apending the last element of a list instead of appending based on current index [duplicate]
This is what I am trying to do:
part 1: I look for names and ages in a text using regex and putting them is separate lists.
part 2: Then I want to create a 3D list that would store name and age pairs.
...
0
votes
5
answers
69
views
How to use the next index of an array in a for..of + if condition in Javascript?
I'm creating a word filter that if index 1 = dog and index 2 = cat, it will return true. What should I put in next index for word?
let textContainer = ['bird', 'dog', 'cat', 'snake', 'rabbit', 'ox'...
2
votes
4
answers
32
views
Too many composite(multi column )indexing is ok?
Consider we have A,B,C,D,E,F,G,H columns in my table and if I make composite indexing on column ABCDE because these column are coming in where clause and then I want composite indexing on ABCEF ...
0
votes
0
answers
6
views
URL shows 404 in Inspect's network, URL not indexing. Google says Not Found
Network in Inspect after loading the page:
Request URL: https://www.gativan.in/blog/Request
Method: GET
Status Code: 404
Remote Address: 13.227.254.33:443
Referrer Policy: strict-origin-when-cross-...
0
votes
1
answer
53
views
Multiple ORDER BY DESC will not use index in Postgres
I'm trying to create some queries in order to implement a cursor pagination (something like this: https://shopify.engineering/pagination-relative-cursors) on Postgres. In my implementation I'm trying ...
-2
votes
1
answer
18
views
which index type should i choose in MongoDb
When i create index in mongo db, mongodb compass asks me to choose index type. Here are the selections. What does these options mean? Which option should i choose?
-4
votes
0
answers
24
views
React JS Code meta data: Google Console says: Page fetch error : Failed: Not found (404) [closed]
The child URLs in my React Website not indexed even after adding a robots.txt, sitemap.xml files in the code. What am I missing to get the URLs indexed??
My website gativan.in is getting indexed. But ...
0
votes
0
answers
40
views
why I can't use the pointer in place of index in an array to return the value and express the position of index?
This is my code, where I am trying to arrange given numbers in an array into an ascending order with the help of pointers instead of indices. I kept trying to use pointer for expressing variables and ...
0
votes
1
answer
20
views
Elasticsearch Completion Suggester - How to discard non-letter characters during indexing?
Here's my index:
PUT autocomplete-food
{
"mappings": {
"properties": {
"suggest": {
"type": "completion"
}
}
}
}
...
1
vote
0
answers
15
views
None of my posts are getting indexed since last 3 days [closed]
enter image description here
None of my posts are getting indexed since last 3 days
None of my posts are getting indexed since last 3 days
0
votes
0
answers
19
views
C#: Get Biggest Indexes in 2d Array [duplicate]
I'm on about my third day of C# programming and ran into a confusing issue. I'm attempting to get the biggest index utilized in a 2D Array of booleans. So given:
booleans = new bool[x,y];
booleans[0,0]...
0
votes
1
answer
14
views
Creating an indexed column in R, grouped by user_id, and not increase when NA
I want to create a column (in R) that indexes the presence of a number in another column grouped by a user_id column. And when the other column is NA, the new desired column should not increase.
The ...
1
vote
2
answers
36
views
Apply 1D array representing index to element translation over 2D array of index values?
I have a 2D array
arr = np.array([
[ 1, 2, -1, -1],
[ 0, 1, -1, -1],
[ 3, 5, -1, -1],
[ 7, 8, -1, -1],
[ 6, 7, -1, -1],
[ 9, 11, -1, -1]])
Its elements are related to the ...
0
votes
1
answer
15
views
Python + ElasticSearch: Mapper Parsing Exceptions for join field
I'm using ElasticSearch 8.3.2 to store some data I have. The data consists of metabolites and several "studies" for each metabolite, with each study in turn containing concentration values. ...
0
votes
1
answer
35
views
If I slice a Numpy array according to a numerical condition, is there a Pythonic way to find the slicing indices that would give the same result?
I have a lot of pictures that I have to perform some data analysis on. Currently all of the pictures look like the one below:
enter image description here
Before the images can be processed I must ...
0
votes
0
answers
37
views
How to extract data from one CSV file to another one using index value
I have to filter the data, therefore I need to create new CSV file based on the filters.
I am having a trouble doing it, cause the new file does not change after I run the code
Below is my code. Where ...
0
votes
0
answers
26
views
What kind of element in that array? How it calls and where i can learn more about it? [duplicate]
That's my first own question on StackOwerflow.
My problem in JavaScript's arrays is:
var arr=[];
arr[0] = 'a';
arr[1] = 'b';
arr['2']='c';
arr['x']='d';
arr.y='e';
console.log(arr);
[ 'a', 'b', 'c', ...
0
votes
0
answers
18
views
Query execution was interrupted while creating an index
My table has 3m records. I am using AWS RDS. When creating a new index
create index jobs_view_stats_created_at_job_id_index on jobs_view_stats (created_at, job_id)
This error is returned:
[70100][...