All Posts Create a Post  
1
votes
134
views
Copying subfolders and files from one folder only if they don't exist in another folder
Posted at 4 months, 1 week ago / May 24, 2021, 6 a.m.

I have a master folder which contains many subfolders and files in it, and a child folder. When a new file is added to the master folder, I need to …

172 5 5 0
1
votes
164
views
Getting error with deployed Serverless Flask app on AWS, No module named 'werkzeug._compat'
Posted at 4 months, 1 week ago / May 23, 2021, noon

I have created a simple Flask app and successfully deployed it to AWS Lambda. I am following the first steps of this tutorial. When the Lambda is run, the following …

172 5 5 0
0
votes
237
views
Negative time difference in Pandas
Posted at 4 months, 1 week ago / May 22, 2021, 6 a.m.

I get this strange result by substracting earlier time stamp for later one: pd.to_datetime('2021-05-21 06:00:00') - pd.to_datetime('2021-05-21 06:02:00') Output: Timedelta('-1 days +23:58:00') Expected Output: Timedelta('-0 days 00:02:00') What is the …

172 5 5 0
0
votes
142
views
In Pandas, giving a datetime index, with rows on all work days, how to determine if a row is beginning of week or end of week?
Posted at 4 months, 1 week ago / May 20, 2021, 6 p.m.

I have an set of stock information, with datetime set as index, stock market only open on weekdays so all my rows are weekdays, which is fine, I would like …

172 5 5 0
0
votes
109
views
Combine two lists in one dictionary that takes unique values as keys
Posted at 4 months, 1 week ago / May 20, 2021, noon

I have this two lists, with same len: owner=["John","John","Mark","Bill","John","Mark"] restaurant_number=[0,2,3,6,9,10] I want to turn that into a dict that informs the restaurant_number of each owner: d={"John":[0,2,9],"Mark":[3,10],"Bill":[6]} I could do it …

172 5 5 0
0
votes
91
views
How to sum specific columns while keeping the unique ID without nan
Posted at 4 months, 1 week ago / May 20, 2021, 6 a.m.

So my dataframe is- Name ID A B C Sam 11 1 1 1 Sam nan 0 1 4 Dan 12 1 4 4 Dan nan 1 5 0 Dan …

172 5 5 0
0
votes
143
views
How to remove user from telegram channel using python
Posted at 4 months, 1 week ago / May 20, 2021, midnight

I am using telethon for adding users in the telegram channel but how to remove or delete users from Particular telegram channels? There is one function to restrict user so …

172 5 5 0
0
votes
315
views
Regular expression to replace second occurrence of dot
Posted at 4 months, 1 week ago / May 19, 2021, noon

String is Hello.world.hello. I wanted to replace the second occurrence of the dot with ‘_’. str = "Hello. world. Hello!" x = re.sub(r'^((.){1}).', r'\1_', str) #x = str.find(str.find('.') print(x) The …

172 5 5 0
0
votes
98
views
Create a column based on the aggregation of values from multiple column at multiple row indexes
Posted at 4 months, 1 week ago / May 19, 2021, 8:17 a.m.

I’m trying to translate a technical analysis operator from another proprietary language to python as using dataframes, but I got stuck on a problem that seems rather simple, but I …

172 5 5 0
1
votes
220
views
Pylint-django raising error about Django not being configured when that's not the case (VSCode)
Posted at 4 months, 4 weeks ago / May 2, 2021, noon

Pylint-django worked just fine up to version 2.3.x but since 2.4.0 it reports an error on every python-django file: Django was not configured. For more information runpylint–load-plugins=pylint_django –help-msg=django-not-configuredpylint(django-not-configured) This happens …

172 5 5 0
  Page 1 of 12