Questions tagged [reindex]

459 questions
3
votes
1 answer

pandas reindex a dataframe with duplicate keys

Here is an example of the problem: >>> df = DataFrame({'a':[1,2]},index=[datetime.today(),datetime.today()+timedelta(days=1)]) >>> df a 2013-02-15 09:36:14.665272 1 2013-02-16 09:36:14.857322 2 >>> dup_index =…
tarotcard
  • 163
  • 1
  • 9
3
votes
1 answer

problems with reindexing dataframes: Reindexing only valid with uniquely valued Index objects

I am having a real strange behaviour when trying to reindex a dataframe in pandas. My version of Pandas is 0.10.0 and I use Python 2.7. Basically, when I load a dataframe: eurusd =…
mspadaccino
  • 382
  • 2
  • 5
  • 17
2
votes
2 answers

Pandas reindex date index by group revisited

This has been asked before and a working solution has been proposed here Pandas reindex dates in Groupby, which worked for me in the past, but it does not work any more. So, to recap I need to reindex dataframe using date to create 'balanced panel'…
izhako
  • 133
  • 1
  • 1
  • 9
2
votes
1 answer

How to reindex and change _type

We need to migrate a number of indexes from ElasticSearch 6.8 to ElasticSearch 7.x. To be able to do this, we now need to go back and fix a large number of documents are the _type field of these documents aren't _doc as required. We fixed this for…
mieliespoor
  • 945
  • 2
  • 8
  • 23
2
votes
1 answer

In pandas, how to reindex(fill 0) in level 2 in multiindex

I have a dataframe pivot table with 2 level of index: month and rating. The rating should be 1,2,3 (not to be confused with the columns 1,2,3). I found that for some months, the rating could be missing. E.g, (Population and 2021-10) only has rating…
Summer
  • 241
  • 2
  • 10
  • 23
2
votes
2 answers

How to reorder the days of week in this Pandas Pivot Table?

import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import datetime df = pd.read_excel("Baltimore Towing Division.xlsx",sheet_name="TowingData") df['Month'] =…
jcalderin
  • 47
  • 5
2
votes
1 answer

reindexObject fails during FileField to BlobField migration in Plone 4.0.7

I'm trying to migrate from plone 3.3.5 to plone 4.0.7 and I'm stuck on a step that converts all the FileFields to BlobFields. Plone upgrade script successfully converts all native FileFields but I have several custom AT-based classes which have to…
Alex Volkov
  • 2,812
  • 23
  • 27
2
votes
2 answers

reindex multi level index with missing categories

I have a dataframe with two indexes, group and class. I have a dictionary containing additional levels that need to be added in to both those indexes. Specifically I want to add E to the group index. And i want to ensure all g1, g2, and g3 are…
an10b3
  • 273
  • 1
  • 8
2
votes
1 answer

Schedule REINDEX table CONCURRENTLY job

Aurora Postgress 12.6 Purpose: schedule to rebuild all indexes. what I did is create a function that calls all tables names and reindex concurrently and put the function in pg_cron but it gives me the error "SQL Error [25001]: ERROR: REINDEX…
user3706888
  • 159
  • 2
  • 11
2
votes
1 answer

Reindex and alias - avoid duplicate search results

I am using one alias for search with one index index_1 with is_write_index set to true. Due to mapping changes I need to reindex and this is my indexing process. Create a new index index_2 with the new mapping Reindex index_1 to index_2 Add the…
mnaa
  • 416
  • 4
  • 12
2
votes
1 answer

Creating New Columns with Conditional Logic and depending on if columns exist

I have a dataframe like this: df A B C D E 1 0 1 0 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0…
Stan
  • 786
  • 1
  • 9
  • 25
2
votes
1 answer

Full Index Rebuild with 5M documents on Elastic search 7.6 takes 1 week to complete

Hope all are doing well Currently Elastic 7.6 is running on cluster with 3 nodes and it's having 5M records in it. While performing the Full rebuild of indexed is taking huge amount of time. But other server metrics like CPU and GC is within the…
Neha
  • 21
  • 1
2
votes
1 answer

Apache Solr Reindexing not working with huge set of records

I'm trying to reindex records in solr collection to a new collection using collections api and for a collection with 6000 records it is working fine and within 5 minutes all documents in source collection is getting copied to target collection. But…
2
votes
1 answer

Update rows in Pandas Dataframe based on the list values

I have a DataFrame that looks like this: product units_sold week sku 5 W01 sku 3 W02 sku 2 W03 sku 4 W04 sku 6 W05 sku 5 W36 sku 3 W38 sku …
Antonych
  • 79
  • 7
2
votes
2 answers

Elasticsearch: Issues reindexing - ending up with more than one type

ES 6.8.6 I am trying to reindex some indexes to reduce the number shards. The original index had a type of 'auth' but recently I added a template that used _doc. When I tried: curl -X POST "localhost:9200/_reindex?pretty" -H 'Content-Type:…
Russell Fulton
  • 570
  • 4
  • 17