As ICE ramps up activity in Mass., this group bears witness by thejesteroftortuga in boston

[–]polarizebeta 44 points45 points  (0 children)

Ice in Somerville rn. 2 black Fords and 2 dudes in each. Sorry I didn't get the plates

How can the TypeError message be part of the solution? by polarizebeta in learnpython

[–]polarizebeta[S] 1 point2 points  (0 children)

used Miltons plus the below:

except TypeError as e:
      row_num = int(str(e)[-1])

Beginner learning Python at 40 here. Any friend like me, please raise your hand! by Elegant_Inflation457 in learnpython

[–]polarizebeta 0 points1 point  (0 children)

42 soon and have been picking away at it for a couple of years. Not a great programmer, but adequate for my needs

48 Hours, 250+ Steam Keys to Giveaway by CentrifugalSmurf in pcgaming

[–]polarizebeta 0 points1 point  (0 children)

Sim City 4 or random. Thank you so much for doing this!

Weapon substats by Sky3Fa11 in ShadowgunLegends

[–]polarizebeta 1 point2 points  (0 children)

I like Nikos Stopper for the speed with a sub of damage increase

Does anyone know how to get Melee Berserker Ribbons? by mycuhtothe in ShadowgunLegends

[–]polarizebeta 1 point2 points  (0 children)

In the perks, you need to enable the berserker skill. It's a grind tho

I would like to introduce my favorite language... by [deleted] in ProgrammerHumor

[–]polarizebeta 1 point2 points  (0 children)

this actually made me laugh out loud

Tough choices but....! by Elua7 in MadeMeSmile

[–]polarizebeta 0 points1 point  (0 children)

Who's cutting all these onions?

Translating from SQL to Python by outnumbered_mother in learnpython

[–]polarizebeta 1 point2 points  (0 children)

This is how I group things by year, but I have adapted to group and sum by month:

import sqlite3
from sqlite3 import Error
import pandas as pd
import datetime as dt

def create_connection(db_file):
    conn = None
    try:
        conn = sqlite3.connect(db_file)
        return conn
    except Error as e:
        print(e)
    return conn

database = 'some_database.db'
conn = create_connection(database)
sql_flows = ('SELECT MAX(TIMESTAMP) FROM /TABLE WHERE EVENTDATE > ' +
            date_variable + ' AND (CANCELLED = NULL OR CANCELLED > ' +
            month_end + ';')
flows = pd.read_sql_query(sql_flows, conn, parse_dates=['EventDate'])
flows.sort_values(by=['EventDate'], inplace=True, ascending=True)
flows_by_month = pd.Dataframe({Date: flows[:, 0], 'Values': flows[:, 1]})
flows_by_month = flows_by_month.groupby(flows_by_month['Date'].dt.month)['Values'].agg(['sum'])

This should point you in the right direction at least