Questions tagged [dataframe]
A data frame is a 2D tabular data structure. Usually, it contains data where rows are observations and columns are variables and are allowed to be of different types (as distinct from an array or matrix). 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.
dataframe
146,818
questions
0
votes
0
answers
9
views
getting the latest date for a a duplicated item in r
I have the following dataset.
I am trying to get the latest SEnd value for each individual tag (see Desired output) where I have the Tag, Owner and the latest SEnd date. Essentially getting the latest ...
1
vote
1
answer
20
views
How to add a time column that increments based on id column value in pandas?
I've an api endpoint that provides json data which when converted into a DataFrame looks something like this-
index id name value time
1 101 A 12 00:12:00
2 101 ...
2
votes
2
answers
41
views
How can I pad a list column in a polars dataframe until the length of the list equals to the size indicated in another column?
I have two columns in a dataframe, pad_size and pad_start:
# Example Polars DataFrame with arrays pad_start and pad_size
data = {
'pad_size': [5, 4, 3],
'pad_start': [[1, 2], [4, 5, 6], [7]]
}
...
1
vote
1
answer
35
views
Complicated triple sum in pandas dataframe
I have a pandas dataframe that looks like
import pandas as pd
data = {
"Race_ID": [1,1,1,2,2,2,2,2,3,3,3,4,4,5,5,5,5,5,5],
"Student_ID": [3,5,4,1,2,3,4,5,4,3,7,2,3,9,10,2,3,6,...
0
votes
0
answers
17
views
R, summarize dataframe based on certain columns and put 1 column values into list [duplicate]
I have a large dataframe and I need to summarize based on 3 columns (source, source_detail, information) and values in column year will be put into list, like in Table 2.
My first code is
data %>% ...
-1
votes
0
answers
46
views
Pandas : Merge Two Dataframe using Condition
I Have a question about how to merge dataframe using conditon.
I have two dataframe
df1
Pro fg material_df1 qty_df1
1 f01 m01 1
1 f01 m02 1
1 f01 m03 1
1 f01 m05 1
2 f01 m01 2
2 ...
0
votes
0
answers
26
views
Convert List of JSON to Dataframe to Multiple Excel Sheets
I have list of multiple objects that I want to convert into excel and I need individual object to be on different sheets. I have looped the list then to convert to Dataframe see below list of json I ...
0
votes
0
answers
18
views
In Python: I need to generate a dataframe with the first business day of each month between two dates based on a custom holiday calendar
With that code below, i can generate a dataframe with all business days between two dates, but i dont know how to filter to only be included in dataframe the first business day of each month.
class ...
-1
votes
0
answers
18
views
Plotly line graph doesn't display properly on google colab
Graph doesn't display according to designated dates.
Tried to create a automated plotly line graph to convert csv files to PNG format
import pandas as pd
import plotly.express as px
def present_line(...
0
votes
1
answer
32
views
web scraping table using pandas
I am learning web scraping on a course on coursera. I tried the code given in the course on my Mac (I use PyCharm by the way) but I got many errors. I guess it has to do with missing libraries or ...
1
vote
1
answer
39
views
Get the Max value from a dataframe
I have a polars dataframe that contains the following columns ID, Values_A , Values_B. I'm trying to get the last date for a filter that im going to use later, so i need the get the most recent date ...
0
votes
0
answers
6
views
Synthetic Data Vault get_column_plot change legend and title
How do I change title and legend for Synthetic Data Vault get_column_plot command ? The documentation gives no such option at all https://docs.sdv.dev/sdv/single-table-data/evaluation/visualization. I ...
-3
votes
0
answers
46
views
How to set values in a dataframe column that depends if another column value is bigger than a dict/lookup table
I have a dataset with date and id columns, and I want to set a third column 'Status' where if the date is before the value in the dict/lookup table, then 'On', 'Off' if on or after the date.
For ...
7
votes
1
answer
108
views
Translate Pandas groupby plus resample to Polars in Python
I have this code that generates a toy DataFrame (production df is much complex):
import polars as pl
import numpy as np
import pandas as pd
def create_timeseries_df(num_rows):
date_rng = pd....
-2
votes
0
answers
29
views
How to get all occurrences of a string using regex in R? [duplicate]
Let's say I have a string
Str1 -> "[18.01,19.023],[20.0289,20.9273],[32.474742,284.383732]"
This is like a set of coordinates of type [x,y] and I want to extract all the "x" and ...