Skip to main content
Advice
1 vote
4 replies
71 views

I am wanting to assign a group indicator to my data based on the difference between a value of a field in the row and the value in the same field in the previous row. I think data.table's shift() ...
Will Phillips's user avatar
0 votes
1 answer
105 views

I’ve attached an image of the dataset I’m currently working on in my Python notebook. I’m in the process of cleaning the data, but I’m stuck on a few rows where some values are misaligned — they need ...
Creative's user avatar
0 votes
6 answers
267 views

I need to create a program that can do this: Input: args2 one two three Output: You have entered 3 arguments: #1: one #2: two #3: three This is what I have so far: #!/bin/bash echo "You have ...
waterscapes's user avatar
1 vote
0 answers
38 views

I am plotting a 2D heat map as part of my research in python using plt.colormesh() and I am able to get nice plots this way: raw data plot I want to get rid of the bowing (artifact of experimental set ...
def_con's user avatar
  • 11
0 votes
0 answers
16 views

I'm trying to implement a Caesar Cipher in NASM (32-bit) that reads from an input file, applies a shift, and writes to an output file. The program should shift each letter by the given amount and ...
MiniX D's user avatar
  • 11
3 votes
2 answers
78 views

Here is my dataframe: A B C First row to delete row to shift Second row to delete row to shift And I want this output : A B C First row to shift Second row to shift I tried this code : df.shift(-1, ...
Julio's user avatar
  • 99
6 votes
3 answers
162 views

Let's take the following code which we compile for a 32 bit system: typedef unsigned int uint32; typedef unsigned char uint8; ... uint8 y = 0xFF; uint32 x = (y << 24U); y can be promoted to int ...
Sterpu Mihai's user avatar
0 votes
1 answer
122 views

When I use .shift() from Pandas on a column in a DataFrame with a date index, I can use it, for example, with .corr(), but I cannot update my old DataFrame or create a new one. Dataset My df looks ...
Mihuu's user avatar
  • 1
6 votes
1 answer
118 views

Consider the following Python code: from decimal import Decimal d = Decimal("1.23") print(f"{d = }, {d.shift(1) = }") When I execute it in Python 3.12.4, I get this output: d = ...
HaroldFinch's user avatar
0 votes
0 answers
123 views

I have a list of dataframes: data1 = {'rec_number': [1, 2, ,3 ,4, 5, 6]} data2 = {'rec_number': [1, 2, ,3 ,4, 5, 6, 7, 8]} data3 = {'rec_number': [1, 2, ,3 ,4]} df1 = pd.DataFrame(data1) df2 = pd....
Richard Li's user avatar
1 vote
2 answers
72 views

I have a dataframe with a datetime (with milisseconds) as index and a price column. I want to create a new column with the nearest price from the row 20s earlier. For example: Data Hora 2024-02-01 10:...
João Weckerle's user avatar
1 vote
3 answers
83 views

Here's a dataframe, with some parameters for each id by some regular quarterly dates. It's originally shuffled randomly, but, at first, let say, it is sorted by fab_date and id. import pandas as pd np....
Howdyouride's user avatar
2 votes
2 answers
62 views

I have a dataframe that contains promo campaign duration and I need to rid off time-stamp overlapping. import pandas as pd import numpy as np from pandas import Timestamp t1 = np.array([['Store A', ...
Andrew Nikitin's user avatar
1 vote
1 answer
84 views

is my code import pandas as pd columns1 = ['Student ID', 'Course ID', 'Marks'] data1 = [(1, 10, 100), (2, 400, 200), (3, 30, 300), (3, 30, 300), (3, 30, 300), (3, 30, 300), (3, 30, 300), (3, 30, 300)]...
Amirhossein Teymourian's user avatar
1 vote
1 answer
439 views

Sorry, I'm starting out in Polars. Is there a way to achieve the same functionality of the shift(n) function where n is a dataframe variable. When I try: df = pl.DataFrame({ "a": [1, 2, ...
user23486287's user avatar

15 30 50 per page
1
2 3 4 5
71