Skip to main content
Filter by
Sorted by
Tagged with
6 votes
4 answers
217 views

I have a trouble with my C-code. My input is a string. The calculator has to count how many times the first character in the string repeats until it finds another different character and write down ...
Puck's user avatar
  • 223
3 votes
4 answers
151 views

I want to increment a column value based on a certain condition within a polars dataframe, while considering how many times that condition was met. Example data. import polars as pl df = pl.DataFrame(...
armeya vaidya's user avatar
0 votes
4 answers
195 views

I get a string like this: AABBBB$CCCDEEE$AABADEE And I want a result like this: 2A4B$3CD3E$2ABAD2E To do that, I made a for loop on the string array. It works well: import re string = "AABBBB$...
Tawal's user avatar
  • 111
0 votes
1 answer
79 views

I would like to implement the expand procedure of the macro CSRCESRV in another programming language (in my case Java). Unfortunately, the exact compression algorithm that CSRCESRV uses is nowhere ...
CodingTil's user avatar
  • 507
2 votes
4 answers
86 views

I have the following run-length encoding data. df1 <- structure(list(lengths = c(2L, 3L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 3L, 1L), values = c(10, 9, NA, 5, 4, 3, NA, 2, NA, 1, 0, NA, 0)), row....
David Moore's user avatar
  • 1,026
0 votes
1 answer
458 views

Suppose I have an RGB image with 3 bit color depth as displayed below. My uncompressed image size would therefore be width * height * color depth in my case 200 * 200 * 3 = 120000 bits. What would be ...
blabla muhaha's user avatar
0 votes
1 answer
155 views

How do I go about tagging the consecutive occurrence of 1s in a dataset using Polars? I found a very similar question here answered. I am trying to tag the data with a unique integer identifier to ...
SkyAdd's user avatar
  • 3
0 votes
1 answer
422 views

I am trying to come up with the most idiomatic/elegant way to do a streak counter in Polars - either streaks of consecutive values or of consecutive rows in which a given condition is met. For example:...
David's user avatar
  • 33
2 votes
2 answers
476 views

I have the following DataFrame: import polars as pl pl.Config(tbl_rows=16) data = [0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0] df = pl.DataFrame({"test": data}) I want to achieve the ...
Young Eddie's user avatar
1 vote
1 answer
537 views

I have some polars code that functionally can do what I want, but I feel it is an inefficient implementation at best. I feel that there must be some way to achieve the same result with .map_batches(), ...
bdshoener's user avatar
1 vote
3 answers
743 views

TL;DR I'd like to be able to concisely (with performance) filter on contiguous row uniqueness, not continuous row uniqueness. Context I have a LazyFrame with data already ordered correctly. While each ...
tsujp's user avatar
  • 1,096
4 votes
1 answer
1k views

I am hoping to count consecutive values in a column, preferably using Polars expressions. import polars df = pl.DataFrame( {"value": [True,True,True,False,False,True,False,False,True,True]...
JGrant06's user avatar
2 votes
1 answer
96 views

I'm writing an RLE algorithm in C# that can work on any file as input. The approach to encoding I'm taking is as follows: An RLE packet contains 1 byte for the length and 1 byte for the value. For ...
Wolf's user avatar
  • 97
0 votes
1 answer
174 views

I am trying to decode a string that can contain numbers but am not sure in how these characters can be detected apart from pattern matching like this. This is not meant to be done with any imported ...
user avatar
0 votes
0 answers
91 views

I'm looking to write a run length encoder in vb which when called, encodes the text of a input and sets it as the text of a label. I have the call coded, but the encoding definition is beyond any. Any ...
Løri's user avatar
  • 1
1 vote
1 answer
2k views

I have a function for run length decoding in Python. It is working with single digit numbers, but if my number is above 9, it doesn't work. As you can see in my code, I want to print c 11 times, but ...
Itay's user avatar
  • 11
0 votes
1 answer
36 views

I would like to write a function which would allow to filter the input data. My input data is a list object containing named numeric vectors (minimal reproducible example below - dummy list). vec1 <...
ramen's user avatar
  • 792
0 votes
2 answers
2k views

like the title suggest I want to do an RLE algorithm and I have few problems with that for example in RLE algorithm if we take aaaabbbccd it should return a4b3c2d1 as a result the rle function should ...
MrTiredVeryTired's user avatar
2 votes
2 answers
2k views

I have some data with 2 columns in the following format: import polars as pl df = pl.from_repr(""" ┌──────┬─────────┐ │ nums ┆ letters │ │ --- ┆ --- │ │ i64 ┆ str │ ╞══════╪══...
zareami10's user avatar
  • 311
0 votes
0 answers
102 views

I need to write two functions called compress(S) and decompress(S) that take a binary string S of length less than or equal to 64 as input and return another binary string as output. The output ...
parth hirpara's user avatar
0 votes
2 answers
446 views

I've got some Textures from an old computer game. They are stored in one huge file with a simple run-length encoding. I know the image width, and height, the images have also some fully transperant ...
Ferris Mertn's user avatar
2 votes
2 answers
109 views

There's a combinatorics puzzle (as mentioned in Mathematics From the Birth of Numbers by Jan Gullberg) where if you line up fifteen members from two categories each (e.g. fifteen of category 0 and ...
147pm's user avatar
  • 2,289
3 votes
5 answers
755 views

so i need to code a program which, for example if given the input 3[a]2[b], prints "aaabb" or when given 3[ab]2[c],prints "abababcc"(basicly prints that amount of that letter in ...
krox's user avatar
  • 39
0 votes
1 answer
1k views

I can't find out what's going wrong in this snippet of my code. The error occurs on the data_in_bit <=data_in(posit + 1) library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ...
IThink's user avatar
  • 1
0 votes
2 answers
930 views

I'm a new developer and got some questions from a test this week and coundn't find a way to solve this one. Any ideas? The problem I believe is to sort a Javascript string which you have to convert ...
Luiz Delgado Gomes's user avatar

1
2 3 4 5 6