Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 106445

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Use the python tag for all Python related questions. If you believe your question may be even more specific, you can include a version specific tag such as python-3.x.

3 votes
1 answer
84 views

Creating names from URLs

print(df.head()) df['Name'] = df['URL'] print(df.head()) #set Name based on substring in URL df.loc[df['Name'].str.contains("pandas", na=False), 'Name'] = "PANDAS" df.loc[df['Name'].str.contains("python … |pitone", na=False), 'Name'] = "PYTHON" print(df.head()) …
shamalaia's user avatar
  • 294
3 votes
2 answers
69 views

speeding up matrix corruption

I need to randomly erase 33% of the non-zero elements in each line of a matrix. Side note: The end goal is to train a denoising autoencoder to remove this noise. My solution: import numpy as np matri …
shamalaia's user avatar
  • 294
2 votes
1 answer
54 views

find max value in islands defined by other vector

I have a vector of values vals, a same-dimension vector of frequencies freqs, and a set of frequency values pins. I need to find the max values of vals within the corresponding interval around each pi …
shamalaia's user avatar
  • 294
3 votes
2 answers
289 views

rolling quarterly mean

I want to calculate the quarterly average of a time-indexed dataframe column in a rolling fashion. The mean at any timestamp should not contain information about future timestamps. This is a code to t …
shamalaia's user avatar
  • 294
3 votes
1 answer
65 views

List of dates with special formatting

I have a code that calls many times a function returning a list of the dates between two dates formatted as ('0001-01-01 00:01:00'),('0001-01-02 00:01:00'), ... The current solution is: import …
shamalaia's user avatar
  • 294