Questions tagged [reindex]

459 questions
4
votes
1 answer

Moving index from one column to another in pandas data frame

I get a DataFrame from a library with an index already set to one of the data columns. What would be the easiest way to set it to another column, preserving the original index column. Input: df =…
Krzysztof Słowiński
  • 6,239
  • 8
  • 44
  • 62
4
votes
1 answer

Change the order of index in pandas DataFrame with multiindex

I am trying to find a straightforward way to change the order of values in a pandas DatafFrame multiindex. To illustrate what I mean, suppose we have a DataFrame with multiindex define as follows: index = pd.MultiIndex(levels=[[u'C', u'D', u'M'],…
user3821012
  • 1,291
  • 2
  • 16
  • 27
4
votes
1 answer

Error in slicing pandas DataFrame based on Missing column names

I have a pandas dataframe with multiple indexes and columns I want to slice this dataframe based on some column names, but sometimes the given column names are not in the dataframe. Pandas raises a warning to use .reindex instead of .loc But I found…
Mohammad ElNesr
  • 2,477
  • 4
  • 27
  • 44
4
votes
1 answer

Reindexing Elasticsearch index with parent and child relationship

we currently have a 'message' that can have a link to a 'parent' message. E.g. a reply would have the original message as the parent_id. PUT { "mappings": { "message": { "properties": { "subject": { "type": "text" …
Ben
  • 1,922
  • 3
  • 23
  • 37
4
votes
1 answer

Rebuilding Indexes with Scripts

I'm looking for help modifying the following script or at least making sure it's correct to rebuild the indexes on a table in my database called SearchTable. I'm brand new to SQL and I don't want to destroy anything. SELECT 'ALTER INDEX ALL ON ' +…
E. Peterson
  • 432
  • 2
  • 6
  • 15
4
votes
1 answer

Marklogic API to get the reindex status of databases

Hi please help me in getting the reindex status of databases using marklogic API. Right now we are using some thing like this: let $forest-reports := let $forest-reports := for $forest-id in xdmp:database-forests($db-id)…
4
votes
0 answers

Rails sunspot reindex - progress bar: Max must be a positive integer

I am trying use sunpost and I am failing during rake sunspot:reindex with this error: Error using progress bar: Max must be a positive integer This error occurs even if database is empty. I am using this: - ruby-1.9.3-p448 - rails-3.2.18 -…
Vosa
  • 41
  • 2
4
votes
2 answers

Using pandas reindex with floats: interpolation

Can you explain this bizarre behaviour? df=pd.DataFrame({'year':[1986,1987,1988],'bomb':arange(3)}).set_index('year') In [9]: df.reindex(arange(1986,1988.125,.125)) Out[9]: bomb 1986.000 0 1986.125 NaN 1986.250 NaN 1986.375 …
CPBL
  • 3,783
  • 4
  • 34
  • 44
4
votes
4 answers

MAGENTO: How can I reindexing data after update?

I am using the following script to update my inventory. After update I want to clean cache, and re-index data, because the updated value on qty is not set in product page. How can I do this? $mageFilename = '../app/Mage.php'; require_once…
user1716516
3
votes
1 answer

Elasticsearch reindex API - Not able to reindex large number of documents

I'm using Elasticsearch's reindex API to migrate logs from an old cluster to a new version 7.9.2 cluster. Here is the command I'm using. curl -X POST "new_host:9200/_reindex?pretty&refresh&wait_for_completion=true" -H 'Content-Type:…
Shiv Rajawat
  • 898
  • 9
  • 21
3
votes
1 answer

Reindexing in PostgreSql

How can I figure out what all the indexes need to be reindexed in a Postgres Database?And I need to schedule a job to reindex the indexes in Postgres, How often should I run it? And stats gathering of Indexes can be taken care of Autoanalyze of…
3
votes
2 answers

Reindexing a series returns NaNs in Pandas

The following code returns a series with NaNs everywhere: s = pd.Series([1, 2, 3, 4, 5, 6], index=pd.MultiIndex.from_product([["A", "B"], ["c", "d", "e"]])) s.reindex([('E', 'g'), ('E', 'h'), ('E', 'i'), ('F', 'g'), ('F', 'h'),…
user8270077
  • 4,621
  • 17
  • 75
  • 140
3
votes
1 answer

Reindex in Pandas is not accepting axis argument?

I am running the examples in the pandas documentation (https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reindex.html) and I got an unexpected exception: index = ['Firefox', 'Chrome', 'Safari', 'IE10', 'Konqueror'] df =…
user8270077
  • 4,621
  • 17
  • 75
  • 140
3
votes
4 answers

Elasticsearch reindex items in existing type mapping

I added a new property to a type mapping and I need to reindex all existing items of that type in order to use the new property. Which API should I use to do this?
johnnyodonnell
  • 1,838
  • 3
  • 16
  • 34
3
votes
0 answers

Elastic - Nested Mapping ReIndex

I created an elastic document with dynamic mapping. As by default elastic does not take the json array as nested but i wanted the mapping to be nested. As a solution i had to create a new index with mapping changes to nested and reindex all the…
rishi
  • 173
  • 1
  • 1
  • 7