Questions tagged [reindex]
459 questions
12
votes
2 answers
In python pandas, how can I re-sample and interpolate a DataFrame?
I have a pd DataFrame, typically on this format:
1 2 3 4
0.1100 0.0000E+00 1.0000E+00 5.0000E+00
0.1323 7.7444E-05 8.7935E-01 1.0452E+00
0.1545 4.3548E-04 7.7209E-01 4.5432E-01
0.1768 1.2130E-03 6.7193E-01…

Marius
- 137
- 2
- 7
12
votes
1 answer
Reindex a dataframe with duplicate index values
So I imported and merged 4 csv's into one dataframe called data. However, upon inspecting the dataframe's index with:
index_series = pd.Series(data.index.values)
index_series.value_counts()
I see that multiple index entries have 4 counts. I want to…

Justin H
- 163
- 1
- 1
- 7
12
votes
4 answers
Reindexing Elastic search via Bulk API, scan and scroll
I am trying to re-index my Elastic search setup, currently looking at the Elastic search documentation and an example using the Python API
I'm a little bit confused as to how this all works though. I was able to obtain the scroll ID from the Python…

Zack
- 13,454
- 24
- 75
- 113
11
votes
3 answers
Naturally sort a flat array without preserving original keys
Is there any way for natsort() to also change the indexes?
I.e.
$array = array('IMG0.png', 'img12.png', 'img10.png', 'img2.png', 'img1.png', 'IMG3.png');
natsort($array);
Array
(
[0] => IMG0.png
[4] => img1.png
[3] => img2.png
[5]…

joedborg
- 17,651
- 32
- 84
- 118
10
votes
5 answers
Merge two multidimensional arrays and reindex all subarrays
I have two arrays, I want to merge these two arrays into single array. Please view the detail below:
First Array:
Array
(
[0] => Array
(
[a] => 1
[b] => 2
[c] => 3
)
[1] => Array
…

Rajesh Shrestha
- 107
- 1
- 1
- 9
10
votes
1 answer
Re-index dataframe by new range of dates
I have a data frame containing a number of observations:
date colour orders
2014-10-20 red 7
2014-10-21 red 10
2014-10-20 yellow 3
I would like to re-index the data frame and standardise the dates.
date …

Gianluca
- 6,307
- 19
- 44
- 65
9
votes
2 answers
pandas DataFrame reset_index which can handle duplicate column names?
Is there any equivalent of pandas.DataFrame.reset_index() which operates on the columns and can handle the case of duplicate column names? I want it to throw away the column names and return a default numbered index 0,1,2.. for the columns. (Methods…

FLab
- 7,136
- 5
- 36
- 69
8
votes
6 answers
Pandas-Add missing years in time series data with duplicate years
I have a dataset like this where data for some years are missing .
County Year Pop
12 1999 1.1
12 2001 1.2
13 1999 1.0
13 2000 1.1
I want something like
County Year Pop
12 1999 1.1
12 2000 NaN
12 2001 1.2
13 1999…

ks2882
- 191
- 1
- 6
8
votes
1 answer
"ValueError: cannot reindex from a duplicate axis"
I have the following df:
Timestamp A B C ...
2014-11-09 00:00:00 NaN 1 NaN NaN
2014-11-09 00:00:00 2 NaN NaN NaN …

Marzia
- 91
- 2
- 2
- 3
7
votes
1 answer
How to check progress of ElasticSearch's Reindex API
I'm trying to execute a reindex operation from remote ES 2.4 cluster via Reindex API. Which job is to transfer more then 100 million docs of an index to latest version of elasticsearch.
For the test case i'm trying it on small data set but i'm…

Waqas Afzal
- 113
- 1
- 5
7
votes
1 answer
How to swap index and values on pandas dataframe
I have some data, in which the index is a threshold, and the values are trns (true negative rates) for two classes, 0 and 1.
I want to get a dataframe, indexed by the tnr, of the threshold that corresponds to that tnr, for each class. Essentially,…

sapo_cosmico
- 6,274
- 12
- 45
- 58
5
votes
3 answers
How can i manually reindex solr using sunspot?
I have couchdb. Sunspot was correctly indexing everything. But the Solr server crashed. I need to reindex the whole thing. rake sunspot:reindex wont work as it is tigthly coupled with active record. sunspot.index(model.all) didnt work. the solr core…

Mahesh M
- 1,219
- 10
- 18
5
votes
1 answer
How do I drop all invalid indexes in postgres?
Using this query:
I have hundreds of invalid indexes:
SELECT * FROM pg_class, pg_index WHERE pg_index.indisvalid = false AND pg_index.indexrelid = pg_class.oid;
public | post_aggregates_pkey_ccnew_ccnew_ccnew1
public |…

dessalines
- 6,352
- 5
- 42
- 59
5
votes
2 answers
How to migrate index from Old Server to new server of elasticsearch
I have one index in old elasticsearch server in 6.2.0 version (windows server) and now I am trying to move it to new server (Linux) on 7.6.2 version of elasticsearch. I tried below command to migrate my index from old to new server but it is…

Mr. Gaurav Singh Rathore
- 55
- 3
- 11
5
votes
3 answers
How can I know the Elasticsearch version an index was created in?
Is there any way to know which Elasticsearch version a particular index was created in?
This is mainly useful when you want to upgrade your cluster and there might be older indices which need to be reindexed to a newer version prior to upgrade the…

ernirulez
- 671
- 1
- 9
- 20