Questions tagged [reindex]
459 questions
1
vote
1 answer
How to create rows for missing years and quarters in pandas dataframe
I have a dataframe in pandas like:
year quarter value
2018 3 100
2018 4 200
2019 2 300
2019 3 380
2020 1 400
In this I want years 2019-1,2019-4 are missing. I want to create and fill these values with previous row values.…

richa verma
- 247
- 2
- 13
1
vote
0 answers
Pandas pivot table re-indexing lose margins?
I've been exploring with pandas pivot table when I came across 2 questions.
Say I now have a pivot table like this:
pd.pivot_table(df, values='age', index='Name', columns=['Domestic?', 'Size'], margins=True)
Output:
Domestic? Y N…

user754625
- 11
- 3
1
vote
2 answers
Reindex the DatetimeIndex of Dataframe Gives only Missing Data
I'm running out of ideas with this one: I'm using a dataset that is read in using
import pandas as pd
data = pd.read_csv('data.csv', index_col=[0], names=['Date', 'GDAXI', 'GSPC'], header=0)
data
Output:
GDAXI GSPC
Date …

Paul
- 23
- 2
1
vote
1 answer
Elasticsearch reindex with same source and destination
I have updated my mappings/synonyms. I would like to reindex my data to the same index.
I tried _reindex API
POST _reindex
{
"source": {
"index": "test"
},
"dest": {
"index": "test"
}
}
I get the following error
{
"error": {
…

Kaushik J
- 962
- 7
- 17
1
vote
1 answer
How to reindex a spesific column in Pandas?
gd = df.groupby(['subID'])['Accuracy'].std()
print(gd)
subID
4 0.810423
5 0.841364
6 0.881007
8 0.763175
9 0.760102
10 0.905283
12 0.928358
14 0.779291
15 0.912377
1018 0.926683
It displays…

Emin Baybars Timur
- 87
- 1
- 5
1
vote
1 answer
pandas reindex method='pad' not working as expected with MultiIndex
I want to reindex a Multindex of two columns (string and datetime64). However, the method pad does not work as I expect.
My code is the following:
df = pd.read_csv('./Artikelstatus.csv',
sep=';',
…

Marius Spix
- 11
- 2
1
vote
1 answer
Is there a limit on the number of fields specified in the “include” param in Reindex call
This is the error message I am facing while executing the Reindex call
[2020-03-13T16:08:39,042][WARN ][o.e.i.r.TransportReindexAction]
[ExportDatabase] giving up on search because it failed with a
non-retryable exception
…

HRS
- 23
- 4
1
vote
1 answer
How to append a character to a string in elasticsearch?
I am attempting to write a transformation while using the _reindex API. The idea is that I'm taking an existing index, I want to reindex it and append a number to the end of a few hash string parameters in the process (type string). Is this a viable…

guibvieira
- 125
- 1
- 2
- 11
1
vote
2 answers
MarkLogic Re-indexing in progress & Forest replicas changeover
MarkLogic 9.0.8.2
We have configured MarkLogic cluster (3 nodes) as follows
PF - primary forest, RF - replica forest
Host1: PF01 RF02 RF03
Host2: PF02 RF01 RF03
Host3: PF03 RF01 RF02
In normal scenario, when we see database status page, PF should be…

Manish Joisar
- 1,256
- 3
- 23
- 47
1
vote
1 answer
Drop Rows (ie. fill with NaN) and interpolate in Pandas Dataframe
I'm working with some times series data and need to filter out some garbage. The goal is to keep the time stamps and interpolate data that is junk.
I've tried just filtering int out and reindexing, but python doesn't seem to treat datetime indices…

Josh Felloway
- 11
- 1
1
vote
0 answers
Magento 2 reindex process stuck on Category Products and Product Categories
I am working on Magento 2.3.2. I am doing reindex but the process is never ends for Product Categories and Category Products.
I tried to reset these both and tried to reindex one by one. But nothing worked. It is just showing processing. No error or…

David Coder
- 1,138
- 2
- 14
- 48
1
vote
2 answers
Reindexing Multiindex dataframe
I have Multiindex dataframe and I want to reindex it. However, I get 'duplicate axis error'.
Product Date col1
A September 2019 5
October 2019 7
B September 2019 2
October 2019 4
How…

JuniorESE
- 267
- 1
- 7
1
vote
0 answers
Is it possible to ignore json_parse_exception during reindex in Elasticsearch?
I am trying to reindex an existing index into a new one with different analyzers.
es.reindex({
"source": {"index": "index"},
"dest": {"index": settings.ES_INDEX}
}, wait_for_completion=True, request_timeout=36000)
The data is…

user1354033
- 203
- 2
- 10
1
vote
2 answers
Using reindex within function is only producing NaN values
Simple example dataframe
df = pd.DataFrame({
'year': [1900, 1901, 1901, 1901, 1902, 1903, 1903, 1903, 1905]
})
I have the below function that takes in a pandas dataframe:
def my_function(df):
df = df.groupby(['year']) # group the df by…

trombonebraveheart
- 81
- 1
- 8
1
vote
1 answer
How to _reindex elasticsearch data to new mapping (from flat fields to objects)?
I have an old index (elasticsearch index) has more than 20K objects, this index has fields
{
"title": "Test title",
"title_ar": "عنوان تجريبي",
"body": "
......
" } I want to _reindex them to convert all data to new mapping like…
Abdallah Sabri
- 431
- 4
- 20