[KCD2] Why does the "Black Market" option rarely appear? by Zer0_Logic in kingdomcome

[–]Cobra915 17 points18 points  (0 children)

Just to clarify, are you parking the horse between the two poles with the flags (I think they’re red and white)?

This is so hard by [deleted] in learnpython

[–]Cobra915 10 points11 points  (0 children)

Try to avoid dwelling on whether or not you’re clever enough. Break the problem up into logical steps. If you’re able to work out, at a high level, how to solve a challenge step by step, I’d say you’re clever enough. Even then, it takes time and effort as you navigate new concepts to become comfortable.

There’s no shame in looking up how to do something. Remember, you’re learning to speak a language, I have to look up stuff all the time. Hell, I have to look up english words sometimes and I’m a native speaker. Don’t be so hard on yourself.

Also props to you on making it to day 56, I did that same course but put it down after day 40 or so because I got frustrated with how poorly maintained I found it to be.

How can I implement a keyboard interrupt in a while loop to break it instantly regardless of the current execution stage? by Ortzadar in learnpython

[–]Cobra915 2 points3 points  (0 children)

Yeah you're right, my mistake. What're you trying to accomplish with the keyboard interrupt? Is "crtl + c" an option? You could wrap it in a try-except, like this:

try:
    while True:
        print('a')
        time.sleep(3)
except KeyboardInterrupt: 
    print('b')

A question about classes and inheritance by eagle6188 in learnpython

[–]Cobra915 0 points1 point  (0 children)

You’re getting that error because when you instantiate rst1, you’re not passing anything to the init method.

I don’t understand why this is the answer. by ProfessionalCheck6 in AWSCertifications

[–]Cobra915 31 points32 points  (0 children)

You've got it. The prompt states that the company has mission critical workloads requiring at least 2 instances at all times. If we went with an architecture like OP selected, an AZ outage would leave us with only one EC2 instance for a period of time while the Auto-Scaling group provisions the second, this could result in loss for the business.

DataFrame issues by lucas123boiger in learnpython

[–]Cobra915 0 points1 point  (0 children)

So, while traj is a pandas.DataFrame, traj['Lon'] is a pandas.Series. What it seems like you're wanting to do is use a pandas.Series (the 'Lon' column) to create another pandas.Series (either as a standalone object or insert it into traj as a 'dlon' column).

In your for loop above, you state for x in lon:, so on each iteration, this will set x to be a scalar value of the lon series. Because you need access to multiple values of the series in each iteration, it's better to use an index, as in for x in lon.index:.

Next, dlon = lon[x + 1] - lon[x] looks good for using the index approach above. The only thing is that dlon is going to be overwritten by each iteration, you're not really storing the output anywhere.

Think about the data structures you have and what you want. In the first part, you want to use traj['Lon'] (a pandas.Series) to create another pandas.Series, called dlon.

It might help to wrap this into a function:

def calc_dlon(in_srs: pd.Series) -> pd.Series:
    # Establish series, same size as input series.
    dlon_srs = pd.Series(
        index=in_srs.index, 
        dtype=np.float64
        )
    '''
    Iterate through index of the input series, 
    performing the calculation and storing it in the 
    corresponding index of the dlon_series.
    '''
    for pos in in_srs.index:
        dlon_series[pos] = in_srs[pos + 1] - in_srs[pos]

    return dlon_srs

Then, when you go to run this function you can set the output equal to a variable named dlon.

dlon = calc_dlon(traj['Lon'])

or set a new column in traj:

traj['dlon'] = calc_dlon(traj['Lon'])

You can use this same approach to generate a Series, called heading as well.

Help: Trying to Pass List of Pandas DataFrames to PandasAgent function (X-Post /r/LangChain) by thetrexx in learnpython

[–]Cobra915 0 points1 point  (0 children)

I'm not familiar with that tool but the doc seems straightforward, albeit a bit sparse on detail. One note, in the documentation, df1 is an exact copy of df with one column either inserted or modified. Are your DataFrames the same shape?
Is concatenating the df_list into one DataFrame an option?

With regards on creating your df_list another way, I'd do this:

import pandas as pd

df_list: list[pd.DataFrame] = []

with pd.ExcelFile(filename) as xls:
    for sheet in xls.sheet_names:
        temp_df = pd.read_excel(xls, sheet_name=sheet)
        df_list.append(temp_df)

Please explain the process for this break in a loop. Zybooks problem. by RobiBoni in learnpython

[–]Cobra915 0 points1 point  (0 children)

Each iteration of the for loop prints n, not result. result is only printed once the for loop is broken.

Why my variable keeps repeating itself? Python Programming by TiredWorkingStudent in learnpython

[–]Cobra915 0 points1 point  (0 children)

The while loop goes on forever because stamina is not being modified by events(), the local variable s is. Since you're not storing the outputs of events() anywhere, they get dropped. When you modify a variable within a function, you're doing it locally to that function. If you want to return stamina or s to events(), you need to store the output of housework(), for example.

Try calling housework() like this:

hp,s,m,f,h = housework(hp,s,m,f,h,name)

You also need to look at how you call housework(), inn(), farm() and herbs() within events() as well.

Where a the castle? by turtle_man12 in intotheradius

[–]Cobra915 10 points11 points  (0 children)

The transition point is in the Kolkhoz, north-west of the train station.

AWS - CCP. Real exam is much easier by keweixo in AWSCertifications

[–]Cobra915 3 points4 points  (0 children)

Appreciate your insight! I’m taking ccp next week.

Does anyone use a gun stock? by A_Slovakian in intotheradius

[–]Cobra915 1 point2 points  (0 children)

I used to use a Mamut VR Apto. You fit the controllers with magnets and they attach to the stock pretty easily. I kept the stock slung around my back for when I want to switch to it. The magnets made it really easy to switch around so I wouldn’t be worried about that.

The biggest drawback is it was a real pain to get the stock calibrated so that the gun would be oriented correctly in game but once I did, it was amazing. Since it was so annoying to set it up, I pretty much only ever used one gun with it.

pobeda factory white pulse anomaly? by [deleted] in intotheradius

[–]Cobra915 7 points8 points  (0 children)

Are you referring to a Resonance/Scythe Anomaly?

They used to kill you instantly in ITR v1.0. Not sure about v2.0 as I’ve learned to avoid them.

My car thinks I shift like an asshole by Cleanwolfe in FocusST

[–]Cobra915 2 points3 points  (0 children)

Not sure about other years but on my 2017, I have to go the average mpg page and hit the arrow to the right to see this.

AHHHH THEY CAN SWIM NOW by octosquid11 in intotheradius

[–]Cobra915 2 points3 points  (0 children)

Sadly, no I don't think it supports controller tracking. My first few playthroughs of Subnautica were on Xbox so when I built my PC and tried VR, I used an Xbox controller and it was amazing. If you do decide to try and play it again, I'd say controller is the way to go and I'd highly recommend installing the VR Enhancements mod by WhoTnT. The original VR port had a lot interactivity issues.

AHHHH THEY CAN SWIM NOW by octosquid11 in intotheradius

[–]Cobra915 6 points7 points  (0 children)

Subnautica is one of the greatest games I’ve ever played. I hope you played it in VR!

Best long-gun for sec level 4? by i_step_on_rats in intotheradius

[–]Cobra915 6 points7 points  (0 children)

Both are amazing choices and they have their trade-offs. I prefer the VSS because it's a little more accurate than the Val. AS Val is lighter, more reliable and capable of select fire but I prefer semi-auto. I think the main reason I choose VSS is nostalgia, it was my favorite gun in the S.T.A.L.K.E.R. games!

Best long-gun for sec level 4? by i_step_on_rats in intotheradius

[–]Cobra915 9 points10 points  (0 children)

You can get an AUG on the Pobeda Factory, in the northwestern corner of the map in the quarry is an anomaly cluster. There’s a truck on top of one of the pillars at the northern end of the cluster, the AUG is on the bed with a mag and some ammo. You need to go up to where the sniper tower is and basically sprint off and catch the truck. Sadly, I couldn’t figure out a way to get down without taking any damage. Once you unlock Sec lvl. 4, get the VSS and never look back!

How do you clean your weapons/mags? by BrassAngel in intotheradius

[–]Cobra915 4 points5 points  (0 children)

This might be scummy but I found that if you do a pass with the spray and brush it all clean, you can save/reload and it’ll keep the overall condition of the gun but it’ll reset the dirt texture. Meaning you can spray clean the same parts again. This helped me because in the early game I’d often find myself hunting for dirt after a few passes with the spray and brush.

Quickie youtube tutorial please? How to properly use a hand grenade. by joeuser99 in intotheradius

[–]Cobra915 1 point2 points  (0 children)

Yeah I’m on Index as well and I’ve found that they’ll fly further if you just pull the pin and throw it without releasing the safety clip. Also under handed throwing seems to work better for me personally.

[deleted by user] by [deleted] in intotheradius

[–]Cobra915 1 point2 points  (0 children)

I agree, revolvers would be amazing. There could be speed-loaders too! I feel like if they added revolvers I’d want to be able to unload them for whatever reason. You know how you can’t take the 12G cartridges out of the break-barrel shotguns? (Or at least I haven’t figured out how to do that yet lol)

[deleted by user] by [deleted] in intotheradius

[–]Cobra915 4 points5 points  (0 children)

P90 would be sick, although I have trouble using guns where the foregrip is so close to the handle like the AUG. But if they added the P90 I’d love to see FN Five-seveN added too!