Skip to main content

All Questions

Tagged with
0 votes
1 answer
45 views

Filter datetime column with object as data type in python

I have a df with a Timestamp and Value columns. Both have the 'object' dtype | Timestamp | Value | -------------------------------------- | 8/21/2023 12:00:00 AM | a | | 11/...
aditya tandel's user avatar
0 votes
1 answer
47 views

Pyspark Filtering Array inside a Struct column

I have a column in my Spark DataFrame that has this schema: root |-- my_feature_name: struct (nullable = true) | |-- first_profiles: map (nullable = true) | | |-- key: string | | |--...
MathLal's user avatar
  • 392
-3 votes
1 answer
65 views

Does filter have a way to export the "list" one element at a time?

On a practice exercise about prime numbers I found out that filter does not return a list itself and I need to do: list(filter()) to obtain that list. I do the exercise twice, once with a for loop: ...
bola8divad's user avatar
-4 votes
1 answer
33 views

how to extract files from a list using substring filter [duplicate]

I have a list of files from os.listdir like: TXSHP_20240712052921.csv TXSHP_20240715045301.csv TXSHP_FC_20210323084010.csv TXSHP_FC_20231116060918.csv how do I extract only the ones where 'FC' is ...
Ben Smith's user avatar
  • 362
0 votes
1 answer
57 views

xml.etree.ElementTree. Element object has no attribute 'nsmap'

I try to process xml data from the website https://www.marktstammdatenregister.de/MaStR/Datendownload I downloaded some datasets for a certain technology for example Netzanschlusspunkte. First step ...
Mlle Blanche's user avatar
0 votes
0 answers
23 views

How to keep ag grid filter after selecting all filtered?

I have an ag grid table that I am filtering, and upon a button click it is set to select all the rows that are currently filtered using selectAllFiltered(), and after clicking the button the filtered ...
Cameron Kranz's user avatar
0 votes
2 answers
76 views

What does "lambda x: x-0 and x-1" mean? [duplicate]

What does the expression do? my_tuple = (0, 1, 2, 3, 4, 5) foo = list(filter(lambda x: x-0 and x-1, my_tuple)) print(foo) What output is to be expected from above equation?
user26230692's user avatar
0 votes
0 answers
8 views

Madgwick Filter Results Unstable with Stationary Input Data

I'm implementing a Madgwick filter using the `ahrs` library in Python, but I'm encountering an issue where the results are not stable when I input data from a stationary sensor. The output angles are ...
d3dalo's user avatar
  • 11
0 votes
3 answers
53 views

Automatically filtered a specific element in a list and input them in a separate lists

I am working on a large list of data. The list should look like this List=[1,2,3,0,0,0,0,4,5,6,0,0,0,7,8,9] It consists of chain of positive number, and is discreted by 0 values. I want to take to ...
thanhbinh nguyen's user avatar
0 votes
1 answer
45 views

How to write a function to read csv files with different separators in pandas in Python?

I have a bunch of CSV files for different years named my_file_2019, my_file_2020, my_file_2023 and so on. Some files have tab separator while others have semi-colon. I want to write a common function ...
hbstha123's user avatar
  • 1,456
0 votes
2 answers
32 views

Filtering dictionary elements by few initial values [closed]

I have the following data structure: Clients= { "data": [ { "nClients": 3 }, { "name": "Mark", "...
Sim81's user avatar
  • 1,779
2 votes
4 answers
92 views

Filter DataFrame events not in time windows DataFrame

I have a DataFrame of events (Event Name - Time) and a DataFrame of time windows (Start Time - End Time). I want to get a DataFrame containing only the events not in any of the time windows. I am ...
Yakir Shlezinger's user avatar
0 votes
0 answers
40 views

How to correctly pass FFMPEG arguments using PYTHON? [duplicate]

I wrote script to create a hardcoded overlay onto a video from a .txt data file using this command syntax: ffmpeg -i 'input.mp4' -vf "ass='subfile.ass'" -c:v h264_qsv 'output.mp4' If I do ...
Kaj Ervo's user avatar
0 votes
0 answers
28 views

How do I filter a list of dicts with a list of strings in Python? [duplicate]

I have a list of dicts which I would like to filter with another list, but am having trouble with the filter() function list_of_dicts = [{'name': 'Bob'},{'name': 'Alice'},{'name':'Jenny'}] list_2 = ['...
Neil Enriquez's user avatar
0 votes
2 answers
37 views

Pandas - Filter - TypeError: 'in <string>' requires string as left operand, not list

I am exploring Pandas filter and while doing so I came across this error while using the below query df2.filter(like = ['Republic','United'], axis=0 ) How do I provide a list in Like parameter in ...
srijan bansal's user avatar

15 30 50 per page
1
2 3 4 5
203