Questions tagged [multi-level]
The multi-level tag has no usage guidance.
multi-level
541
questions
1
vote
1
answer
37
views
Pandas multilevel Pivot/Transpose
I've looked thru countless examples, but I cannot figure out how to do the below.
Any tips would be greatly appreciated
Original df (note the multilevel)
Gender A B
sum ...
0
votes
0
answers
23
views
pd.concat with multilevel columns dataframe
Im newbie in python so Im struggling to make python bot to trading in stock market of my country .
import requests
import time
import json
import pandas as pd
import schedule
Tickers = ['ETHUSDT', '...
1
vote
1
answer
28
views
Combine two level headers in df based on condition
I have the df from the excel file that has double headers. The df looks like this but the first two rows are actually headers:
Name
Unnamed
Age
Unnamed
Country
Unnamed
Is there a way to combine ...
0
votes
0
answers
28
views
Filter Pandas dataframe column based on values in second column [duplicate]
I have a pandas data frame
Column A
Column B
Report 1
Vendor A
Report 1
Vendor B
Report 2
Vender C
Report 2
Vendor B
Report 3
Vendor A
Report 3
Vendor C
I'm looking for a way to exclude any ...
2
votes
1
answer
77
views
Pandas: change multiple level column name to one level
I have a dataframe with two-level column names as:
ID Value
A B
----------------
1 6
2 5
3 4
4 3
5 2
6 1
I want to change the column head with:
column_mapping = {
('ID', 'A') : '...
0
votes
0
answers
9
views
Multilevel model vs. aggregating data
I have a mediation model, where a level-2 independent variable influences a level-2 mediator and this then has an impact on a level-1 dependent variable. For argument sake, let's call level-2 the ...
1
vote
1
answer
48
views
Multi-Level Header in Pandas DataFrame
I have the following table in a csv file:
wi_document_id
wir_rejected_by
wir_reason
wir_sys_created_on
Int0002277
Agent_1
Time out
3/8/2024 11:18:10 AM
Int0002278
Agent_1
Time out
2/26/2024 12:18:...
0
votes
0
answers
20
views
Mice() imputation using 2l.norm method gives Error in chol.default() leading minor of order 1 is not positive
Having an issue with imputation using mice. I'm testing a few ways to impute on a longitudinal dataset, however using the 2l.norm method gives me an error in almost every case I try (as a separate ...
0
votes
0
answers
93
views
Is there a way to have a multilevel mediation analysis with two independent variables?
I got two Level 2 independent variables, one level 1 mediators and one level 1 Dependent variables. Not an expert in R and I tried to locate the code online. So far, the codes or tutorials are meant ...
0
votes
0
answers
56
views
multilevel modeling with two time points - centering?
I am currently working with a dataset that uses two waves in a longitudinal study (wave2 & wave 3).
I am trying to look at whether optimism (optim) and the number of life stressors (life_s) ...
2
votes
4
answers
225
views
Multi-level sorting in Excel with ignoring empty cells
Multi-level sorting would probably be suitable for this task if there was an option “ignore empty cells”.
I need to sort the rows so that the sorting for column A ignores empty cells, and the sorting ...
-1
votes
1
answer
59
views
Instance Variables Are Not Shared Between Processes in Python
I have a big problem with Multi Processing. in this case I have a
1.Main Class in Main Process
2.Foo Class in Another Process
I Have To Change Some Variables Inside of Process2 With Main Process.
How ...
1
vote
1
answer
69
views
Discrepancy between lme4 sample size and complete case dataset?
I'm currently estimating a hierarchical linear model (HLM) using lme4. My entire dataset has 367 observations. lme4 estimated my model using 341 observations - I assumed some were dropped due to ...
2
votes
1
answer
66
views
How to add dfs with different number of column axis levels, but sharing same axis names?
I have two multi-level column dataframes:
data = {
'A': {
'X': {'Value1': 2, 'Value2': 1},
'Y': {'Value1': 2, 'Value2': 3}
},
'B': {
'X': {'Value1': 10, 'Value2': ...
0
votes
2
answers
985
views
Linking figure caption number to chapter number in a different style than Heading 1 in Word
I am using a customized thesis template where the styles are manually created. However, there are no standard Word styles, such as "Heading X." I am trying to include chapter numbers in my ...