Questions tagged [reindex]
459 questions
5
votes
2 answers
Sorting in a Pandas pivot_table
I have been looking all over trying to figure out how to sort my pivot table correctly and I haven't had any luck.
client unit task hours month
0 A DVADA Account Management 6.50 January
1 …

Timothy Mcwilliams
- 184
- 2
- 17
5
votes
2 answers
How to rename a nested field containing dots with elasticsearch rename processor and ingest pipeline
I have a field in elasticsearch (5.5.1) which I need to rename because the name contains a '.' and it is causing various problems. The field I want to rename is nested inside another field.
I am trying to use a Rename Processor in an Ingest Pipeline…

Mnebuerquo
- 5,759
- 5
- 45
- 52
5
votes
3 answers
Pandas crosstab - How to print rows/columns for values that don't exist in the data sets?
I am a beginner with pandas at best and I couldn't find a solution to this problem anywhere.
Let's say I have two variables: variable1, variable2.
They can have the following predefined values:
variable1 = ['1', '4', '9', '15', '20']
variable2 =…

somethingsomethingdangerzone
- 89
- 1
- 2
- 8
5
votes
2 answers
Insert rows and add missing data
I wonder if somebody could give a few pointers on how to proceed with the following. Being a newbie to Pandas, I feel at the moment my overall knowledge and skill level is not sufficient at the moment to be able to process the request I outline…

carlmorter
- 81
- 1
- 4
5
votes
1 answer
Fill datetimeindex gap by NaN
I have two dataframes which are datetimeindexed. One is missing a few of these datetimes (df1) while the other is complete (has regular timestamps without any gaps in this series) and is full of NaN's (df2).
I'm trying to match the values from df1…

tg359x
- 53
- 1
- 5
5
votes
2 answers
ElasticSearch - Reindexing your data with zero downtime
https://www.elastic.co/blog/changing-mapping-with-zero-downtime/
I try to create a new index and reindexing my data with zero downtime with this guide.
Now I have an index called "photoshooter" and I follow the steps
1) Create new index…

Michalis
- 6,686
- 13
- 52
- 78
5
votes
1 answer
PostgreSQL - reindex when add new index
I have a table with 100k records without indexes. I created a new index on column that is used for left join.
Do I need to reindex my table?
Creation of an index took a few ms. So I am guessing that query can not use this index (no data) until I…

Makla
- 9,899
- 16
- 72
- 142
5
votes
1 answer
How can I do an interpolating reindex in pandas using datetime indices?
I have a series with a datetime index, and what I'd like is to interpolate this data using some other, arbitrary datetime index. Essentially what I want is how to make the following code snippet more or less work:
from pandas import Series
import…

Kevin S
- 898
- 1
- 9
- 13
5
votes
1 answer
Does schema change require reindex of all Solr documents or just documents containing the changed schema fields?
I have millions of documents in my Solr index. Only a thousand of those documents have field A, whose schema I want to change. The schema changes include changing multiValued from true to false, stored from false to true, and type from text to…

user2704791
- 53
- 1
- 4
4
votes
2 answers
Elastic Search reindex API - how to preserve destination index mapping?
Let my-index-0 be an ES index with an alias of my-index.
It has the following mapping:
{
"my-index-0": {
"aliases": {
"my-index": {}
},
"mappings": {
"doc": {
"properties": {
…

Paweł Rubin
- 2,030
- 1
- 14
- 25
4
votes
1 answer
Reindex dataframe inside loop
I'm trying to reindex the columns in a set of dataframes inside a loop. This only seems to work outside the loop. See sample code below
import pandas as pd
data1 = [[1,2,3],[4,5,6],[7,8,9]]
data2 = [[10,11,12],[13,14,15],[16,17,18]]
data3 =…

Andrew5715
- 43
- 4
4
votes
3 answers
Pandas: add elements to index at even intervals
I have a dataframe that looks like this:
B
A
0.00 5.7096
7.33 8.0280
25.82 15.7212
43.63 19.5156
55.24 20.1888
and I want to add rows with the index at regular intervals (say by 10), so that I can then interpolate…

ilmatte
- 51
- 3
4
votes
2 answers
Pandas reindex converts all values to NaN
I have a dataframe of the following:
>>> a = pd.DataFrame({'values':[random.randint(-10,10) for i in range(10)]})
>>> a
values
0 -3
1 -8
2 -2
3 3
4 8
5 6
6 -5
7 0
8 8
9 -4
And would…

Recessive
- 1,780
- 2
- 14
- 37
4
votes
1 answer
Skip some columns between two columns when appending dataframe to existing empty dataframe
Currently I'm extracting data from pdf's and putting it in a csv file. I'll explain how this works.
First I create an empty dataframe:
ndataFrame = pandas.DataFrame()
Then I read the data. Assume for simplicity reasons the data is the same for each…

teller.py3
- 822
- 8
- 22
4
votes
3 answers
Pandas Resample Upsample last date / edge of data
I'm trying to upsample weekly data to daily data, however, I'm having difficulty upsampling the last edge. How can I go about this?
import pandas as pd
import datetime
df = pd.DataFrame({
'wk start': ['2018-08-12', '2018-08-12', '2018-08-19'],
…

Mariah Akinbi
- 386
- 1
- 5
- 19