Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
91 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
235 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
26 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
15 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
72 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
151 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
113 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
107 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
118 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
71 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
78 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
56 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
82 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
415 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
0 votes
2 answers
86 views

uint_fast8_t is intended to provide the fastest possible 8-bit (or wider) integer type on the target platform, while uint8_t is a fixed 8-bit unsigned integer type. So the uint_fast8_t b = 0xF0; b<...
John's user avatar
  • 3,574
0 votes
1 answer
176 views

I have a rather interesting task. I need to perform a bit shift with a cutout of the bits. That is, I have a binary .bin file. The first 16 bytes must be skipped, the byte numbering starts from 0, ...
Леонид Ильин's user avatar
2 votes
1 answer
128 views

I'm working through an application to a coding bootcamp and am stuck. I could use some help seeing what I'm doing wrong. I'll post the question, the code and the output. Any help is greatly ...
Room4Renzo's user avatar
2 votes
1 answer
287 views

I'm encountering a TypeError while attempting to transcribe audio from a WAV file using the whisper-node library in my NestJS project. Here's my code snippet: import whisper from 'whisper-node'; ...
Vahe Vardanyan's user avatar
0 votes
2 answers
197 views

I'm learning c++ at uni for a few months so I'm a beginner and in my exam I encountered a problem with template class. The task was to implement a template class in a header file like it was given in ...
Zelei Ádám István's user avatar
1 vote
1 answer
78 views

I have a pandas dataframe df containing 5 rows and 2 columns. A B 0 10 0 1 20 5 2 30 10 3 40 15 4 50 20 df.to_dict() returns {'A': {0: 10, 1: 20, 2: 30, 3: 40, 4: 50}, 'B': {0: 0, 1:...
hbstha123's user avatar
  • 1,810
0 votes
2 answers
288 views

In javascript ,onkeyup event, when I press shfit + key , then release the shift before the key, I don't get the event.key for the key , instead I get "shift". Is there a way to get the event....
Yaakov Whise's user avatar
1 vote
1 answer
125 views

I have this script on polars... import polars as pl from faker import Faker fake = Faker(locale='fr_FR') def my_func(): operation = fake.unique.pystr_format( string_format='??###', ...
Laurent Reynaud's user avatar
0 votes
2 answers
169 views

I have a fixed size array and i want to 'left shift' it. e.g {1,2,3,4} --> {2,3,4} from my understanding arrays are consecutive memory cells, so this should be possible by just changing the start ...
StackMachine's user avatar
0 votes
1 answer
52 views

I am finishing my Informatics assignment and I wrote these for my question: Create a variable s with a value of 154 and a variable p with a value of 6. Display its values in decimal and binary form on ...
Prearea's user avatar
  • 13
0 votes
1 answer
72 views

I am writting a program to shift the numbers entered in a circular manner which i know how to by using call by value , but i am unable to the logic in call by refrence way This is the code: #include&...
Harshal Malani's user avatar
0 votes
0 answers
76 views

In my DataFrame, there might be missing dates (such as weekends, holidays etc.), so the dates are not strictly continuous, and the shift has to be the latest available. For example, if the date is ...
xymzh's user avatar
  • 227
0 votes
1 answer
38 views

Here is an example dataframe. import pandas as pd index_labels = pd.date_range(start='1/1/2018', end='1/08/2018') column_labels = pd.MultiIndex.from_product([['Function A', 'Function B'], ...
John's user avatar
  • 545
0 votes
1 answer
81 views

Given the following data table: Category <- c('A','A','A','A') Year <- c(0,1,2,3) Amount1 <- c(0,100,200,300) Amount2 <- c(0,30,40,0) dt_1 <- data.table(...
highbury's user avatar
  • 169
0 votes
2 answers
125 views

im using python within grasshopper to construct komplex geometrical shapes, therefore i often work with lists and loops. I need to operate one list element with another, the next one in the same list, ...
Julinho91's user avatar
0 votes
1 answer
41 views

I have chronological data (monthly aggregation per customer). df=pd.DataFrame({'cust_id': [1,1,1,1,1,1,2,2,2,2,2], 'period' : [200010,200011,200012,200101,200102,200103,200010,200011,...
Nick's user avatar
  • 3,164
2 votes
3 answers
96 views

I have the following dataframe: import pandas as pd data = [['Construction', '', '01/02/2022', '01/06/2022', '1', 'No'], ['Level Site', 'Construction', '01/02/2022', '01/02/2022', '2', 'No'], ['...
bcoder's user avatar
  • 37
1 vote
2 answers
267 views

So heres a problem it took me a while to figure why its happening... I have a dataframe of values with a datetime index of workdays. Im adding a new column, 'ColB', which is always the same value as ...
AndysPythonStuff's user avatar
2 votes
2 answers
78 views

I have the following data frame (number of "Date" columns can vary): Customer Date1 Date2 Date3 Date4 0 A 10 40.0 NaN 60.0 1 B 20 50.0 NaN NaN 2 ...
dark water's user avatar
1 vote
2 answers
829 views

Time Heave Trim 40.228 -4.057 0.016 40.238 -3.253 0.182 40.248 -3.084 0.12 40.257 -2.957 0.161 40.267 -2.28 0.245 40.277 -2.66 -0.047 40.287 -1.899 0.265 40.297 -1.687 0.141 40....
juv's user avatar
  • 11
0 votes
1 answer
77 views

Matrix(Image Courtesy:Y. Liu et al.: Graph Learning Based on Spatiotemporal Smoothness for Time-Varying Graph Signal Is this matrix a permutation matrix with 0s on the diagonal and 1s above the ...
Mihir Malladi's user avatar
0 votes
0 answers
75 views

I dropped a TouchKeyboard from palette into a form, and I ran the program. When I clicked with mouse on the left Shift (down&up) on TouchKeyboard, and then clicked the right Shift, everything ...
Branko Sretenovic's user avatar
-4 votes
1 answer
233 views

Suppose we have this equation c = m ⊕ (m << 6) ⊕ (m << 10) where ⊕ stands for XOR and << for cyclic shift to the left. How can this be written as m in terms of c? What operations ...
Kostas Sofis's user avatar
0 votes
0 answers
207 views

I am working on a STM32F446RE project. I sense a sinewave of 50 Hz in ADC (alpha) and I want to create an identical sinewave as the first one but shifted by 90 degrees (beta). I tried to implement it ...
user avatar
0 votes
1 answer
538 views

I have some problem when tried to used JOLT for modify JSON. I want to modify each string in array and only leave last 4 character. Sample Input: { "card" : [ "111111111", &...
sizzz's user avatar
  • 1
0 votes
0 answers
31 views

I have sorted data like this: Id A A B C D D D D E and I need to check if value one row above is the same. If it isn't, in new column ['value'] should get value 1 but if it is new column should be ['...
zukowski2012's user avatar
1 vote
1 answer
105 views

I'm trying to get the frequency count of a groupby which is grouped by name and date. I am having trouble figuring out how to do a 3 days roll count prior to the current day. example: on 2022-01-05, ...
ManOnTheMoon's user avatar
0 votes
0 answers
54 views

I accidentally trigger a bug in C code, my goal is to get rightmost 16 bits as unsigned from binary string. #include <stdio.h> #include <stdint.h> int main() { char msg[] = {0x01, ...
gx16's user avatar
  • 192
1 vote
1 answer
65 views

Help with conditional shifting in Pandas I have the following dataframe: rng = pd.date_range('2015-02-24', periods=10, freq='D') win_list = ['Won', 'Lost', 'Won', 'Won', 'Lost', 'Won', 'Lost', 'Lost', ...
idealunique's user avatar
0 votes
2 answers
79 views

A relatively trivial question today Suppose I have a the following code: int extract_bits_21_to_25(unsigned char* instruction) { int instruction_to_int = *(int*)instruction; int ...
HyperCoderSuperion's user avatar
2 votes
2 answers
132 views

I have a specific use case where I need to calculate a running total that is reset/adjusted every time it exceeds another running total in the same dataframe. The running total needs to be reduced ...
Jan's user avatar
  • 21
0 votes
1 answer
180 views

I am not sure where to go with shift and caps key, I don't know whether I can make different values on what I am already working on for this or not. I am new to Jpanel, so any help would be much ...
Zee Man's user avatar
-1 votes
1 answer
588 views

I want to perform displacements on tensors (set of images), for example using torch.roll or some other method. But each displacement I am going to apply to each tensor is different (I would have ...
Erney Ramírez's user avatar
0 votes
1 answer
46 views

Here is my dataframe: timestamp open high low close volume 0 2023-01-03 3.5000 3.5972 3.3700 3.500 25231.0 1 2023-01-04 3.5000 3.5500 3.3000 3.505 40815.0 2 ...
David's user avatar
  • 15
1 vote
1 answer
144 views

When printing to the terminal, the OR operator is not being applied in C++. MWE: #include <iostream> int main() { std::cout << false || true; return 0; }
Hans's user avatar
  • 241
1 vote
3 answers
177 views

I have a very basic question. Lets say I have two variables(uint16_t a, uint16_t b) and in memory they are aligned next to each other like a=> 0x0 => 0x15 and b=> 0x16 to 0x31 Lets assume a =...
Hipster1206's user avatar

1
2 3 4 5
22