Questions tagged [multi-level]
529 questions
92
votes
8 answers
How to simply add a column level to a pandas dataframe
let say I have a dataframe that looks like this:
df = pd.DataFrame(index=list('abcde'), data={'A': range(5), 'B': range(5)})
df
Out[92]:
A B
a 0 0
b 1 1
c 2 2
d 3 3
e 4 4
Asumming that this dataframe already exist, how can I simply…

Steven G
- 16,244
- 8
- 53
- 77
49
votes
7 answers
multinomial logistic multilevel models in R
Problem: I need to estimate a set of multinomial logistic multilevel models and can’t find an appropriate R package. What is the best R package to estimate such models? STATA 13 recently added this feature to their multilevel mixed-effects models –…

Raphael
- 1,143
- 1
- 11
- 16
43
votes
3 answers
Python Pandas: drop a column from a multi-level column index?
I have a multi level column table like this:
a
---+---+---
b | c | f
--+---+---+---
0 | 1 | 2 | 7
1 | 3 | 4 | 9
How can I drop column "c" by name? to look like this:
a
---+---
b | f
--+---+---
0 | 1 | 7
1 | 3 | 9
I tried…

Boosted_d16
- 13,340
- 35
- 98
- 158
25
votes
6 answers
vector of vectors push_back
I'm designing a multilevel queue process simulator in C++ but I've got a problem when trying to implement several queues (my queues are vectors).So,
"multilevel" is a 4 elements array (not vector). Inside each of those elements there is a vector…

karl71
- 1,082
- 2
- 18
- 29
20
votes
3 answers
Pandas: Change a specific column name in dataframe having multilevel columns
I want to find the way change name of specific column in a multilevel dataframe.
With this data:
data = {
('A', '1', 'I'): [1, 2, 3, 4, 5],
('B', '2', 'II'): [1, 2, 3, 4, 5],
('C', '3', 'I'): [1, 2, 3, 4, 5],
('D', '4', 'II'): [1,…

sh.jeon
- 353
- 1
- 3
- 9
12
votes
1 answer
Help with a multilevel menu with json and jquery
I'm trying to do a multilevel menu that slides when ">" is clicked. The first issue is that the CSS is not working properly, the < ul >'s aren't getting floated to the left.
What I'm needing is show only one ul, and if ">" is clicked show the…

Blaya
- 588
- 5
- 11
10
votes
2 answers
overriding abstract methods in an inherited abstract class
Okay so basically I have the following problem: I'm trying to have an abstract class inherit another abstract class that has an abstract method, but I don't want to implement the abstract method in either of them because a third class inherits from…

thed0ctor
- 1,350
- 4
- 17
- 34
9
votes
2 answers
Issue with Expanding Multi-Level ExpandableListView
I have a multi level (3 levels, Root -> Parent -> Child) ExpandableListView containing children that are also ExpandableListViews.
I'm having no issue filling them up; however, I need to expand a specific item in the Parent level when I first…

Tomap
- 638
- 1
- 8
- 21
8
votes
5 answers
Java multi-level break
I have a construct where I have a for loop nested inside of a while loop in Java. Is there a way to call a break statement such that it exits both the for loop and the while loop?

themaestro
- 13,750
- 20
- 56
- 75
8
votes
2 answers
How to create a multilevel dataframe in pandas?
Given two different df's:
'A'
a b
2016-11-21 2 1
2016-11-22 3 4
2016-11-23 5 2
2016-11-24 6 3
2016-11-25 6 3
'B'
a b
2016-11-21 3 0
2016-11-22 1 0
2016-11-23 1 6
2016-11-24 1 5…

hernanavella
- 5,462
- 8
- 47
- 84
7
votes
2 answers
Standardized coefficients for lmer model
I used to use the code below to calculate standardized coefficients of a lmer model. However, with the new version of lme the structure of the returned object has changed.
How to adapt the function stdCoef.lmer to make it work with the new lme4…

majom
- 7,863
- 7
- 55
- 88
6
votes
3 answers
Laravel : create hierarchical route for category
I'm implementing category structure , some products would have one level category but other may have two or more level :
/posts/cat2/post-sulg
/posts/cat-1/sub-1/post-slug
/posts/cat-3/sub../../../post-slug
as i dont know how depth it would be…

alex
- 7,551
- 13
- 48
- 80
6
votes
2 answers
Imputation using mice with clustered data
So I am using the mice package to impute missing data. I'm new to imputation so I've got to a point but have run into a steep learning curve. To give a toy example:
library(mice)
# Using nhanes dataset as example
df1 <- mice(nhanes, m=10)
So as you…

user2498193
- 1,072
- 2
- 13
- 32
6
votes
3 answers
Best Practices for Using Multi Level HashMap in Java
We have a situation where we are ending up using multi-level hash maps; that is, a hash map inside of a hash map, three or four levels deep.
Instinctively this felt wrong somewhere. I have read posts here that talks about how to iterate/use a…

as.tek
- 937
- 3
- 14
- 20
6
votes
5 answers
Multi Level Inheritance in Javascript
I am trying to mock inheritance in Javascript using prototype.
I have a function named Model and a type of model => Item.
var Model = function() {
this.names = ["name1", "name2"];
}
Model.prototype.Item = function(args) {
this.init =…

Nitin
- 7,187
- 6
- 31
- 36