Questions tagged [indexing]

Indexing data structures is a general technique to improve the speed of data lookups.

0
votes
0answers
3 views

Pymongo bulk_write with UpdateOne throwing Scanned Objects / Returned has gone above 5000 alert

I'm having aroung 190 millions records in my collection, it has compound index {"company":1, "date":-1, "datatype":1} and it doesn't have any duplicates documents. Every month I'm upserting around 20 ...
0
votes
0answers
17 views

MySQL doesn't use my index while it declares it will in explain statement

I recently encounter a problem involving MySQL DBSM. The Table is like this: CREATE TABLE `orders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(60) DEFAULT NULL, `age` int(11) DEFAULT ...
0
votes
0answers
8 views

RDMS(postgres) indexing vs elasticsearch indexing

I am a newbie to the elastic search, why can't i use my current RDMS(postgresql) as my full text searching, as postgres has indexing What's the difference between postgres indexing and elastic search ...
1
vote
0answers
5 views

How can I make webpack recognize a custom index.js file?

How can I make webpack recognize a custom index.js file? For example, I want webpack to override index.js with index.ios.js when importing from a folder. import thing from './thing' I tried the ...
0
votes
0answers
9 views

BWA fails to locate index genome

I know this question has been asked before. I have searched through the threads and nothing has made a ton of sense to me. Admittedly, I am a newbie at bioinformatics so maybe the answer is clear to ...
0
votes
2answers
30 views

Can't write out indexer's first value

I am supposed to write a code where the user can give the program the number of indexes, and then give every single one of them values. The problem is, when I try to write the values out, the first ...
0
votes
0answers
14 views

Index exceeds the number of array elements (1)

I trying to use matlab to solve a polynomial with variable parameters. I am using fsolve. The code is given below: function my_fsolve3() % Constant Parameters A = 6.24; B = 5.68e-5; C ...
-2
votes
1answer
25 views

IndexError: string index out of range 2018 python 3

This code basically is mirroring the string you input. I am getting Type something please: Hey Hello ...
0
votes
2answers
8 views

azure sql - create index, does DB have to be offline?

New to Azure SQL. Simple example to ask question. Table Cars. Want to add an non clustered index to Cars table. Takes a long time, say 30 min during staging test deploy. When upgrading production ...
0
votes
2answers
17 views

Updating a dataframe 2 affects the dataframe 1 that was the origin of dataframe 2

I am appending a reverse dataframe to its original dataframe. Seemed like it is all working but than I realized this: df1had the ids (1,1,1,2,2) at first. I applied the function df2['id'] = df2['id']....
1
vote
1answer
31 views

Pandas set_levels on MultiIndex: Level values must be unique

Given a DataFrame df Value Category Pool Class A 1.0 1.0 1 9.0 2 B 1.0 1.0 3 C 1.0 1.0 4 5.0 ...
0
votes
2answers
23 views

Syntax error when attempting to amend a string with indexing

I'm studying APL from here. Why am I getting this syntax error? 'computer' [ 1 2 3 ] ← 'COM' SYNTAX ERROR 'computer'[1 2 3]←'COM' ^ But if I save 'computer' in a variable I don't ...
2
votes
0answers
31 views

Solr not recognising some documents

I am relatively new to Solr, and have not found an answer for this issue. During the indexing process, Solr seems not to recognise certain documents. I realised this may be because the document/file ...
1
vote
1answer
16 views

Excel index matching 2 table

I have a problem when trying to do index matching. I want to match the item and date from table 1 and table 2 to obtain the Order balance. I really have no idea how to solve this. Here is my data, ...
0
votes
2answers
47 views

SQL deterministic function that can use SYSDATE ad still be indexed?

Consider this example: CREATE FUNCTION get_age(date_of_birth DATE) RETURN NUMBER AS BEGIN RETURN TRUNC(MONTHS_BETWEEN(SYSDATE, date_of_birth)/12); END The following query can not be indexed, ...
0
votes
3answers
19 views

Comparing cells with array and printing rows acording to comparison

I'm quite newbie to python and pandas... so I'm using pandas to read and work with .CSV and others excel files... and now I have excel file that looks lets say like this: A B C D E f - - - - 1 g - -...
1
vote
1answer
31 views

Removing index from a list of sublists to return it [duplicate]

There is a lot function involved but im gonna keep it simple : Here is my code : [['Musique', 'Initiation au tango argentin suivi de la milonga', 182, 231], ['Musique', 'The Singing Pianos', 216, ...
2
votes
3answers
65 views

Indexing does not improve performance and sometimes makes it worse

I'm having a table EMPLOYEE(EMP_ID, EMP_NAME, DESC, SALARY) and I want to retrieve all employees that can do magic tricks. Being able to perform magic is classified as a talent and the talent if each ...
0
votes
1answer
51 views

Numpy: Reshaped arrays behaving strangely

I'm trying to reshape a numpy array [link] then reshape that array again, but am not able to achieve my desired result. My data starts in shape (n_vertices, n_time, n_dimensions). I then transform it ...
1
vote
1answer
24 views

Python Numpy - 3-dimensional indices in 2-dimensional array without loop

I want to construct an array V1, of shape (n,p,q) using an array of indices, idx, with the same shape, applied to an array V0, of shape (p,q). The way to construct it with a loop is the following. ...
0
votes
2answers
36 views

Getting unexpected results with MxN matrix

I have this basic template matrix class: template<class T, unsigned N> class Matrix { private: static const unsigned Stride = N; static const unsigned Size = Stride * Stride; T data[...
0
votes
0answers
29 views

Need help using pyplot to plot multiple line charts in same plot for whitespace formatted data

28 121 106 112 134 42 123 114 115 135 56 130 118 124 138 42 123 114 115 135 63 132 126 131 141(and 14 more rows....) basically each row has 5 points that need to be plotted by line graph along ...
1
vote
1answer
31 views

Python - replacing an array via multi-column index and .replace() function

Replace filtered array (a) with another column's same-as-filtered array (b). In[1]import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns....
-1
votes
2answers
21 views

Query multiindex dataframe to differentiate entries in and not in [duplicate]

I have a DataFrame that looks like this: FirstDF= C A B 'a' 'blue' 43 'green' 59 'b' 'red 56 'c' 'green' 80 'orange' 72 Where A and B are set as indexes. I ...
0
votes
2answers
50 views

Word list storage returning “string index out of range”. Why?

I am working on an assignment where we have to ask the user for a word, and then if the word has a letter that repeats the initial letter in the word, such as: ApplesAuce (the A repeats), the program ...
0
votes
1answer
18 views

Sql problems with combinations of multiple characteristics to result in a number to index

Lets say i have a simple table: Laptops Id (int autoincrement, Name nvarchar(50) 2gb Ram ( bit ), 4gb Ram ( bit ), 250 hdd ( bit ) 500 hdd ( bit ) So we have a table for laptops and it has just ...
-5
votes
0answers
16 views

“CREATE INDEX idx_deliverys_delivered ON deliverys USING btree” doesn't work

I uses btree index, postgres for delivery table, Postgres get error CREATE INDEX idx_deliverys_delivered ON deliverys USING btree
2
votes
1answer
26 views

Excel - matching cell values in two columns, if match copy another value to blank cell

I'm trying to get my hands on a solution that will help me to compare each of the values of the cells in column A and D, and if there is a match add the value from column B to respective cell in ...
-2
votes
1answer
28 views

How to tribonacci series value pass in array then print any index value which i want?

//Program: Tribonacci Series import java.util.*; import java.io.*; class Tribonacci { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out....
0
votes
0answers
21 views

Can we create primary index and clustered index on same table?

Primary indexing require sorted and unique value where clustered index require sorted value only. if we create primary index on table then it is hard to be other data in sorted form as well. so can we ...
1
vote
1answer
43 views

Speed Up Simple Multidimensional Counter Code

This is the slow code: def doCounts(maskA1, maskA2, maskA3, counts, maskB): counts[0, maskB & maskA1] += 1 counts[1, maskB & maskA2] += 1 counts[2, maskB & maskA3] += 1 Is ...
2
votes
1answer
24 views

Why is a view object indexable in the context of the Python sorted() function?

step 1: create a dictionary dict1 = {"one": 1, "two": 2, "zero": 0} step 2: reveal dict1's contents dict1 {'one': 1, 'two': 2, 'zero': 0} step 3: create a view object using .items() vwobj = ...
0
votes
1answer
11 views

IndexError: invalid index to scalar variable. (when comparing int value row by row with dataframe's column entries)

I am currently getting the above mentioned IndexError: invalid index to scalar variable.error. What i basically want to do is given a x-Value xEndand a y-value yEnd to check if there is a row in my ...
2
votes
1answer
53 views

MYSQL GROUP BY and WHERE indexes, with timestamp column

I've implemented this query: SELECT evt.userId, evt.storeId, COUNT(1) AS totalVisits FROM Event evt WHERE evt.timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW() AND ...
0
votes
2answers
31 views

Google Sheets - Return all cells based on nearby reference cells/multiple criteria

I'm attempting to create a table which shows averages based on multiple criteria of nearby cells. The best way to explain is with my sample sheet (with edit permission): https://docs.google.com/...
0
votes
0answers
11 views

Why full text search on table with GIN index is still very slow

With what I've been able to gather thus far, if you need to run a full text search on a table in a PostgreSQL database with lots of entries (say on the order 1.2M+), the recommended approach is to ...
0
votes
0answers
40 views

Oracle IOT gives count(1) as 0 even thought it has entries in them

We have an IOT in oracle 11g R2, The table has entries in it. But when we select the count(1) from that table, it returns 0. We droped and re-created the table and it worked fine for some time, ...
0
votes
0answers
40 views

for loop in r, repeatedly access data with index numbers

I have identified the months for which a policy shock was imposed upon, the index numbers of these months is stored in variable "policyIndex". My goal is to access the corresponding home prices 6 ...
1
vote
2answers
49 views

Index/Slicing Pandas DataFrame with Numpy datetime64 objects

I'd like to be able to figure out if I can get the following to work (Pandas 0.23.4). Any help would be most appreciated. import numpy as np import pandas as pd rows = 12 rng = pd.date_range('2011-...
0
votes
1answer
30 views

Matrix index from vector

In MATLAB, I want to retrieve the value of a particular position in a matrix through a vector v = [1, 2, 3, 4]; A(v) A(v(:)) how can I do that? The length of the vector is not fixed so I cannot ...
1
vote
1answer
31 views

Why is my Postgresql instance not using bitmap index scanning?

I have two instances of Postgresql running, one which is on my local machine running version 10.5 and the other version on my production machine running 9.5.10. I create the tables on my local machine ...
0
votes
1answer
27 views

Getting multiple returns from index()

I'm working on a hangman game in Python. My "answer" list contains all the letters of the word in order, the "work" list starts off with dashes for each letter, which are then populated with correct ...
1
vote
1answer
22 views

looping through a dataframe to return rows based on 2 indexes in python

I have a multi indexed dataframe sorted by name and date and time and i would like to go through the dataframe to select the latest(time wise) row for each day. see example below: name time ...
0
votes
0answers
11 views

Reindex pages from other domain [on hold]

I would like to remove some informations from google and i would like to reindex them by google. Some links has in description my nick but in pages my nick isn't available. How to force reindex sites ...
0
votes
4answers
60 views

Python: “list index out of range” when attempting to do a loop that chooses random numbers

My task is to randomize cards with a name and four categories, and to bring them out from a text file and save the completed cards back to another text file. The number of cards randomized is up to ...
0
votes
0answers
10 views

Elasticsearch indexing (DB->ES) decreases dramatically when source is not co-located on same host

We are using Elasticsearch (ES) for GUI search in our products. Years ago we integrated Elasticsearch-1.7. Now we utilize ES 6.4. Now we have to re-index our data. The source data (DB) is a located ...
0
votes
1answer
22 views

mongodb - embedded field vs embedded document indexing

So I'm wondering if I were to create an index on a document, will it also inherently create an index on the embedded fields as well? So for the example: { name: { first: "Yukihiro", ...
1
vote
2answers
34 views

mongdb ensure uniqueness on two fields both ways

Say I have the fields a and b. I want to have a compound uniqueness where if a: 1, b: 2, I would not be able to do a: 2, b: 1. The reason I want this is because I'm making a "friends list" kind of ...
0
votes
2answers
24 views

python array not being populated [duplicate]

I'm working on an assignment for my Python class and I'm super close to it being done but there's this one annoying issue that I can't seem to solve, but before I explain, here's my code: import math ...
-3
votes
0answers
13 views

why cant i PUSH my commit to my repo on GITHUB?

Ok, i recently committed the index.html file successfully onto my git hub, but then i made some changes to the html, i wanted to RE UPDATE the index.html file on my github repo but i could not for the ...