正规365体育投注

Questions tagged [dataframe]

正规365体育投注 A data frame is a tabular data structure. Usually, it contains data where rows are observations and columns are variables of various types. While "data frame" or "dataframe" is the term used for this concept in several languages (R, Apache Spark, deedle, Maple, the pandas library in Python and the DataFrames library in Julia), "table" is the term used in MATLAB and SQL.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Using existing “Date” variable; add month and week variables to the data frame

I have a data frame called Covid19 and it contains a variable called Date. I want to create two new variables Month and Week from the Date variable. The output must look as in the image The code I ...
1
vote
1answer
20 views

print column position of a dataframe

this is my dataframe: c_id string1 age salary string2 1 apple 21 21.22 hello_world 2 orange 41 23.4 world 3 kiwi 81 20.22 hello i need to print the ...
1
vote
2answers
23 views

Creating a column based on matches from a list

I have a data frame with a column of job titles and the company name in the same string of each row, I also have a list of all possible company names. How do I search the column of my data frame to ...
1
vote
2answers
19 views

R- add row to data frame after a specific sting/ pattern

I am trying to fill in some missing data in my data frame, which looks like: ID Value 1234 0001A Text Text 2 1235 0001A 1236 0001A Text Text 2 1237 0001A 1238 0001A 1239 ...
0
votes
2answers
21 views

rows as dictionary into columns of dataframe python

I have a dataframe with two columns, the second column has values as dictionary. I'm trying to convert the key of the dictionary into separate columns of the dataframe. df name values a ...
1
vote
1answer
22 views

Pandas dataframe - count the sum of rows up to the condition and compare it with the list elements

I have this data example: 0 1 2 3 2 Text1 1 1 5 5,00 3 Text2 8 4 0 0,00 4 Text3 1 ...
0
votes
0answers
21 views

Convert each column of a DataFrame into a dictionary and name the dictionary based on column name

I have a DataFrame named distinct_values: gender purchase_frequency 0 Female Low 1 Male Mid 2 Male High 3 Female Mid 4 ...
0
votes
1answer
22 views

Create a set of tuples from dataframe

I have the dataframe as below: Position x y A 1 2 B 2 5 C 1 4 D 0 5 I am trying to create a set of tuples like this: set={'A':(1,2),'B':(2,5),'C':(1,4),'D'...
-3
votes
2answers
25 views

How can I drop many columns from one thousand columns using columns index? [duplicate]

I have one thousand columns, I need to drop many columns using columns index. How can I do this? Thank you.
1
vote
1answer
24 views

Looping values of a column in dataframe to a function in Python

I'm trying to run to a loop (column in a dataframe) over a function which returns a list of dictionary and should store the result of each of the iteration in a separate list for each of the values in ...
0
votes
1answer
26 views

Loops in Dataframe

I have 4 columns: Country, Year, GDP Annual Growth and Field Size in MM Barrels. I am looking for a way to create a loop function that generates the mean GDP growth values over the 5 years following ...
0
votes
0answers
16 views

Expected axis has 6 elements, new values have 7 elements

Hey everyone I'm trying to run code by Sentdex in his Python for Finance series. I have data from the SP500 companies saved into csv files from his previous tutorial but I cant seem to run this code ...
0
votes
1answer
17 views

Getting and saving results from multiple data frames

I have nine different data frames df1, df2, df3, df4, df5, df6, df7, df8 and df9. I want to write a function that apply the following calculation using the mice package for each data frame ...
0
votes
0answers
5 views

How to convert tibble format to dataframe?

I have an error message while I am using deconstructSig.R. The example file is working well but my file data occurs a problem. I think the reason is file format. To use "deconstructSig.R", the file ...
1
vote
1answer
34 views

Renaming columns in list of data frames using match from another data frame

I realise I asked two separate questions in my last post and had one of them answered by very clever peeps super quickly. Obviously I still can't wrap my head around data frame lists or lapply! I ...

15 30 50 per page
1
2 3 4 5
4608