Questions tagged [multiple-columns]
Multiple-columns are when text is split into a number of parallel text columns, rather than one column of text. For CSS Multicolumn layout, use the [css-multicolumn-layout] tag.
5,421
questions
0
votes
0
answers
38
views
ValueError: "Columns must be same length as key" > Python
I'm using Colab to run the code but I get this error and I can't fix it. Could you help me out?
I don't know what to do in order to fix it because I have tried to change upper case or lower case.
#...
0
votes
2
answers
21
views
Erroneous column concatenation Python
I have a data frame where in the first column I have to concatenate the other two if this record is empty.
Cuenta CeCo GLAccount CeCoCeBe
123 A 123 A
234 S 234 ...
0
votes
1
answer
19
views
Creating multiple columns in pandas with lambda function
I'm trying to create a set of new columns with growth rates within my df in a more efficient way than multiply imputing them one by one. My df has +100 variables, but for simplicity, assume the ...
0
votes
2
answers
46
views
Renaming Pandas Column Names to String Datatype
I have a df with column names that do not appear to be of the typcial string datatype. I am trying to rename these column names to give them the same name. I have tried this and I end up with an error....
1
vote
0
answers
25
views
SQL how to display group by results in columns
I used a group by by id and year in a SQL query to display the following table :
id
year
nb
1
2018
10
2
2018
3
3
2019
108
2
2019
873
2
2020
42
1
2019
53
3
2018
423
Here is the SQL code that ...
0
votes
2
answers
27
views
How to fix this columns
It's been a while since I used CSS. I need help with making the column
better. I would like the 2nd row to be aligned. Photos to be of the
same size. And please advise what to do if I decide to make ...
0
votes
2
answers
43
views
Pyspark how to convert columns to maps after grouping and pivoting
How to convert multiple columns to maps after grouping and pivoting in pyspark. Code below is not working as expected.
Input dataframe:
ID
TYPE
Order
Address
Phone
1
A
Primary
abc
111
1
B
Primary
...
0
votes
1
answer
11
views
pandas transpose specific columns to rows keep custom attributes [duplicate]
I loaded an excel file in a dataframe which contains questions, answers and some custom attributes in the first three columns. I would like to transpose all the answers to rows but keep the first ...
-1
votes
1
answer
19
views
Remove specific text from Excel using Python
I'm doing a project and I need to remove some specific text from a string . For example, from these strings I would like to remove the numbers in the end (_230; _0 ; _240) until the '__' .
'...
2
votes
1
answer
31
views
Remove columns in R by two conditions in two different columns
I am using this data.frame. I need to apply statistical tests (wilcox.test) for each column by comparing the '0' to the '1' groups, but I can only do that if each group has at least 2 values. How can ...
3
votes
1
answer
34
views
Wilcox.test error when running multiple times due to NAs (using dplyr in R)
I am using this example data.frame and code. I would like to do multiple tests between two group, but when there are no data in one group, it is causing an error. How can I skip the comparisons ...
0
votes
0
answers
28
views
How do I make a for loop that loops through a dataframe and perform my seasonal decomposition anomaly detection?
Here I read my dataframe with multiple columns
def parser(s):
return datetime.strptime(s, '%m/%d/%Y %H:%M')
main_data = pd.read_csv('hvac_data.csv', parse_dates=[0], index_col=0, date_parser=parser)...
0
votes
1
answer
29
views
Cannot select columns by position and name in R
why does the following code cause an error?
attach(mtcars)
df <- mtcars[,c(1:4,"qsec")]
# Error in `[.data.frame`(mtcars, , c(1:4, "qsec")) :
# undefined columns ...
0
votes
1
answer
23
views
Reading a csv dataset in R where lines and columns are mixed
I have downloaded NOOA archive of hurricanes, the original data was a text file that I imported and saved as csv. Now I am trying to reorder the data, unfortunately observation names are mixed (start ...
-1
votes
0
answers
28
views
Linear interpolation for several columns in R
I have three datasets from World Bank Open Data. "GDP per capita", "Fertility Rate" and "Life expectancy at birth" from 2000 to 2019 and have to linear interpolate the ...
-1
votes
0
answers
16
views
Read and split MySql column containing single and multiple comma sperated values
I have a landing table that has the column name speciality which can have single or multiple comma sperated values.
Now i want to map the corresponding specialityId to each speciality that is in the ...
1
vote
2
answers
42
views
Complex multiple t tests with data in 2 data.frames in R
I have two data.frames (code below). The row ids in the data.frames match.
set.seed(12345)
df1 <- data.frame(id=c(letters),
g1=c(rep(0,7), rep(1,18), "NA"),
g2=c(rep("...
-1
votes
0
answers
17
views
Multi Column Listbox column search
How do you get values from mutli column listbox in C#.
I have a listbox with 2 columns. One is a string and the other column hold decimal values.
I need to run through values of each column to look ...
1
vote
2
answers
60
views
How to dynamically convert dataframe columns to map
How to convert the data to map in PySpark, for dynamic columns?
Input dataframe:
key_column
Column_1
Column_2
.....
Column_N
1
Value_1
Value_2
.....
Value_N
1
Value_a
Value_2
......
Value_Z
2
...
0
votes
1
answer
29
views
Autofilter VBA Excel not working for multiple columns
I am currently using an autofilter in VBA and it is no longer working. I have tried a load of fixes and nothing seems to have worked. I am filtering on columns X & Z. This is my current code:
...
-1
votes
0
answers
45
views
google sheet script Get cell value by row and column
I have a google sheet script that selects some cells in a row and then sends me an email. I did this by setting the cell number by hand and everything works but since there are so many rows isn't ...
1
vote
2
answers
35
views
Is it possible to change the class of multiple columns in a dataframe based on their current class?
I have a large dataframe with 500+ columns with a variety of classes in a variety of orders. Example data:
col1 col2 col3 col4 col5 col6
2 red 1.2 5 5 5.7
4 ...
-1
votes
0
answers
20
views
Renaming column names in SQLite [duplicate]
In SQLite, I am trying to rename a new column after combining 2 tables. I am trying to make it like Table 2, where I want to change ID:1 & ENCID:1 to diagID and diagENCID, respectively. I have ...
0
votes
3
answers
36
views
Searching for values from one column in another by classification, in SQL
I have the following dataset in SQL:
INDIVIDUALS
Town_2012
Town_2017
John
London
Manchester
John
London
London
Steve
Manchester
Leeds
Steve
Bristol
Birmingham
I want to find all the individuals ...
-1
votes
3
answers
41
views
Assign new column in DataFrame based on if value is in a certain value range
I have two DataFrames as follows:
df_discount = pd.DataFrame(data={'Graduation' : np.arange(0,1000,100), 'Discount %' : np.arange(0,50,5)})
df_values = pd.DataFrame(data={'Sum' : [20,801,972,1061,1251]...
-2
votes
0
answers
22
views
creating table UNION several columns but add new separate columns using DAX
The table I created is using UNION(Select Columns)... to UNPIVOT from another table. However, now I need other columns from that said table so how would I combine UNION with another statement to give ...
0
votes
2
answers
46
views
GoogleSheet: Split the last two Capitalized characters in a String into two columns
In examples, three cells contain these values:
ATRAAtara Biotherapeutics, Inc.
PYPLPayPal Holdings, Inc.
AABOSAcumen Pharmaceuticals, Inc.
QUESTION:
What is the GoogleSheet formula to 1) Target the ...
0
votes
1
answer
13
views
r - What is the error in this code to repool/change range
I want to repool all items for a specific scale except WB01_08 and WB01_10.
I want to change the range for the items: "WB01_01", "WB01_02", "WB01_03", "WB01_04",...
0
votes
0
answers
18
views
Can any one help to spilt this data into two colums Name and Emp ID . I had tried Many ways please help me out
df['First_Name']=df['Full Name With ID'].str.extract('([A-Z]\w{0,})',expand=True)
df['First_Name']
Full Name With ID Role
0 ., Anuj (E1IN08093)
1 ., Anusha (E1IN06482)
2 ., Arun Kumar (...
0
votes
0
answers
17
views
column function isnt working when new inputs are in (pandas) [duplicate]
There is a BMI column that needs to calculate my BMI
My inputs are entered via a function
dataframe column that needs to calculate BMI
df['10bmi'] = (df['0kg'] / ((df['14height']/100) * (df['14kg']/...
0
votes
1
answer
18
views
Hello, how can I show 2 record in one column based on ID?
Example, I want to show in column : 12144 = 6, 13
What should I do? Thanks, hope you're help me!
0
votes
2
answers
37
views
Consolidate column values into one column as a list with column name as key in python
I have data frame that looks like this:
id address city pincode
1 here is address 1 city1 1234
2 here is address 2 city2 4321
3 here is address 3 city3 7654
4 here is ...
0
votes
1
answer
24
views
calculate average + sd with multiple conditions and NA values
I am trying to calculate the average and sd of several numeric columns (with NA values) based on three character conditions:
average + sd for (f1,f2,f3,f4) grouped as:
-ps S0/hepatopancreas/sporulated-...
0
votes
1
answer
21
views
Formula to Find Count of Even Numbers in Google Sheets
I have found this question/answer useful:
Formula to Find Count of Odd Numbers in Google Sheets
but whilst it works for my array with odd numbers, I also want to count the even numbers and the ...
0
votes
1
answer
27
views
Add new columns to excel file from multiple datasets with Pandas in Google Colab
I'm trying to add some columns to a excel file after some data but I'm not having good results just overwriting what I have. Let me give you some context: I'm reading a csv, for each column I'm using ...
0
votes
1
answer
23
views
how to use dataframe column headers as row value in a single column, and aggregate multiple column values into one column [duplicate]
i am looking for some help on how to format a pandas dataframe
input
date A B
8/1/2022 $100 $50
desired output
date type amount
8/1/2022 $A $100
8/1/2022 $B $...
0
votes
0
answers
10
views
Table with rows and columns (even merged ones) draggable
I have tried to create a table with rows AND columns with a drag&drop option.
I have managed to do the work with the rows and the JQuery plugin "sortable" with the following code:
$('...
0
votes
0
answers
29
views
2 subset, under 1 column of my pandas dataframe
i have a dataframe with 4 kinds of columns.
Belove one columns i have two subsets of data
for example under the column called "type" i have in the head data called X and in the tail data ...
2
votes
2
answers
52
views
Clean column in data frame
I'm trying to clean one column which contains the ID number which is starting from S and 7 numbers, e.g.: 'S1234567' and save only this number into new column. I started with this column named Remarks,...
0
votes
1
answer
29
views
Auto increment multiple column values from parent id
I have 2 Parent tables like DEPARTMENT and COUNTRY. In both of these tables, I will have a column saying LAST_GENERATED_SEQUENCE. Basically, this will allow me to maintain order of child record ...
0
votes
1
answer
19
views
New column based on values from other columns in python
I have a dataframe df which looks like this
min
max
value
3
9
7
3
4
10
4
4
4
4
10
3
I want to create a new column df['accuracy'] which tells me the accuracy if the df['value'] is in between df['...
0
votes
0
answers
18
views
Creating a repeating pattern of references in excel
Using excel, control + enter sequences references to call based on the cell selected (so d,h,p,l becomes d,e,f,g). Is there a workaround?
0
votes
1
answer
44
views
PySpark remove string before a character from all column names
I have some column names in a dataset that have three underscores ___ in the string. Using PySpark, I would like to remove all characters before the underscores including the underscores, and keep the ...
0
votes
1
answer
28
views
Optimize the code when creating new columns based on the number of token of the row
Is there any way to optimize the following code?
c1_arr = F.col('col1')
c2_arr = F.split('col2', ' ')
arr_of_struct = F.transform(
c1_arr,
lambda x: F.struct(
F.size(F.array_intersect(...
0
votes
1
answer
33
views
How to use IF statement using multiple conditions, AND and OR
Please see attached image
I have listed all the possible combinations for either a Yes or No in Checklist field.
English speaking always has to be Yes, to return Yes in checklist
Months has to be 6 ...
0
votes
2
answers
18
views
How to select multiple rows containing a search strings in multiple columns and create a new column with the rows?
I am working on a dataframe containing text across multiple columns. I would like to identify cells containing a search string and copy the whole cell onto a new column. I know for sure that the ...
0
votes
0
answers
4
views
Make table fit within 1 column (2-column environment)
I am trying to fit this table within a two column environment, but only in one column. Now it is floating over the second column. I think I should either make the column width smaller or rescale the ...
0
votes
0
answers
24
views
Iterate over each row of a pandas df to apply dynamic multiple conditions to the whole df
The code iterates over each row of the DF and uses the value of the cols to filter the main DF and calculate the lenght of it with the filters applied. The values of the row (thus, the filters) change ...
1
vote
1
answer
37
views
transpose grouped rows into from-to columns in r
I have one dataset and I would like to transpose these grouped rows into columns and calculate distance as well.
Let´s say I have a dataset like below
Where "order" column is only related ...
0
votes
1
answer
44
views
How to do AND instead of OR in if statement comparing columns in PyQt5
I have sample data structure like below:
1
2
3
4
5
6
7
8
9
10
11
12
name_x
14
15
16
name_y
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
Brak
CD
CD
CD
Brak
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
...