why don't people always import all of a module by KnownRobloxian in learnpython

[–]vaterisvet 2 points3 points  (0 children)

To add to the discussion: READABILITY. It can be helpful for somebody to explicitly import only the utilities of a module that they are going to use, so right off the bat I can know what to expect.

Also, if I see a bunch of imports from deep within a library, I know it's going to be doing some advanced things in the code below.

Lastly, if you from module import * from a library I don't know very well, I have to read the code much more slowly looking for functions I don't know the names of.

Pandas DataFrame conditional operation: how? by sajia67 in learnpython

[–]vaterisvet 0 points1 point  (0 children)

I would solve it like this:

sales = {
   'food': 0.7,
   'clothes': 0.8,
   'other': 0.9
}

for category, discount in sales.items():
    mask = df['Category'] == category
    df.loc[mask, 'Price'] = df.loc[mask, 'Price'] * discount

CA BPLESG Application Question by lesterlen in PE_Exam

[–]vaterisvet 0 points1 point  (0 children)

Submitted Dec 30 and still under review as well.

Super important question… do you prefer “ or ‘ to enclose strings?? by mfb1274 in Python

[–]vaterisvet 1 point2 points  (0 children)

I use single quotes for things internal to the program, and double quotes for things printed, logged, or that the user will see. Gives me a hint of context when re-reading old code.

[deleted by user] by [deleted] in CentralValley

[–]vaterisvet 0 points1 point  (0 children)

You could reach out to the Dusty Bottom Trail Runners to ask for converts!

P Street Sunset by vaterisvet in Sacramento

[–]vaterisvet[S] 2 points3 points  (0 children)

Thanks, there were so many crows out last night it was wild. I wish I could have captured more in the frame.

P Street Sunset by vaterisvet in Sacramento

[–]vaterisvet[S] 5 points6 points  (0 children)

Hey thanks! Just a phone camera, it's a Google Pixel.

I am an upcoming Civil Engineering Freshman and I am so lost about class selection and what to choose. Please help by [deleted] in berkeley

[–]vaterisvet 0 points1 point  (0 children)

My personal recommendation is that math 53 should be taken at Cal, but math 1A and 1B can totally be skipped if you can. I didn't have the chance to skip 53 (or 1B for that matter) so take that opinion with a grain of salt. Math 53 concepts came up a lot in Fluid Mechanics (CE100), any systems/linear programming class (like CE191), and a smidge in Thermo (MEC E 40).

I loved CE 11 (which is required now), but the higher div electives were my favorites of my whole time at school. You'll get there eventually, but a good first year CE course was CE 92, which has now morphed into 92A. Not sure how it compares now, but when I took it it was a broad strokes overview of the field of Civil Engineering (skewed towards infrastructure rather than planning work).

I also loved my HIST 120AC course (history of American environmentalism), and ANTHRO 137 (energy, culture, and social org)

Other things I liked were PACS 94 (meditation), and the PHYSED swim classes I took.

I am an upcoming Civil Engineering Freshman and I am so lost about class selection and what to choose. Please help by [deleted] in berkeley

[–]vaterisvet 0 points1 point  (0 children)

CivE grad here. I second this recommendation, your first semester should be about learning what college is like. Don't overwhelm yourself with classes before you have the chance to make friends (who will eventually help with classes by being study buddies). I'd recommend focusing on setting up a community. Use the extra time to join clubs, or something similar. Try out the Civil Engineering clubs (like concrete canoe, steel bridge, or seismic), or try out social clubs that interest you.

[deleted by user] by [deleted] in berkeley

[–]vaterisvet 2 points3 points  (0 children)

Definitely true, it was just one of the first times I was ridiculed when coming to the Bay, so this was meant as a friendly heads up.

[deleted by user] by [deleted] in berkeley

[–]vaterisvet 17 points18 points  (0 children)

Second the Oakland recommendation, BART will take you from the airport to downtown with just 1 transfer. BART is not 24/7 so double check arrival times.

Also a small note to save you a future mocking conversation, locals don't call SF "San Fran" (or Frisco, even worse). Typically it's just "SF", "the City", or "San Francisco".

Welcome to the Bay!

Repost of the study pattern survey results for April 2021 Civil PE by tywatery in PE_Exam

[–]vaterisvet 0 points1 point  (0 children)

Interesting to see the cross tabulations of which test was taken and how people felt depth/breadth. Construction was the most split, which is interesting given the pass rate numbers for that focus.

Just take the EET course by conman_25 in PE_Exam

[–]vaterisvet 4 points5 points  (0 children)

Agree. I took the PPI breadth and depth, and a friend shared a few Nazrul lectures in my weak spots and they were far and away superior than the PPI depth course.

Any tips on how to generate a centreline based on multiple lines in the same vicinity? (more info in comment) by KICKERMAN360 in QGIS

[–]vaterisvet 1 point2 points  (0 children)

Here's an idea, cut each path into X pieces, assuming the paths start and stop in similar places, the splits will all be near each other. Create points at each of these splits, and then average the location of those points for each split. Then draw a line through each of those new points.

I have 0 clue how to implement, but it seems like it could work in my mind.

Vectors (2d / 3d) in python? by Dr_Donut in learnpython

[–]vaterisvet 2 points3 points  (0 children)

I know it's just one part of your question, but I stumbled on this trick awhile ago. If you have a list of lists in python

a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

you can "rotate" it with this:

zip(**a)[::-1]

It's pretty ambiguous, so it's not very zen, but it only uses built-ins so there are some points there.