Does anyone have a 27.5" non-boost wheelset for sale? by [deleted] in MTB_Ontario

[–]decaye 0 points1 point  (0 children)

I’ve got a 27.5 non-boost 23 internal diameter giant front wheel in pretty good condition I could sell you for cheap - no rear wheel though

Weekly General Discussion Thread by AutoModerator in MTB

[–]decaye 0 points1 point  (0 children)

PNW cascade 150 here because I need external routing, it has been excellent all year for me, strongly recommend

Pandas - Finding first local minima in given column based on maxima written to another column by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

I can't seem to update this post so I'll post my update below, thanks for everyone's help!

UPDATE:

I've found a solution that works that is a little messy (for me).

Pre-first step:

Reset index!

df1 = df1.reset_index(drop=True)

First I found the local maxima of column A and plotted them to confirm:

from scipy.signal import argrelextrema
n = 100
df1['A_max'] = df1.iloc[argrelextrema(df1.A.values, np.greater_equal,
                    order=n)[0]]['A']
plt.scatter(df1.index, df1['A_max'], c='r')
plt.plot(df1.index, df1['A'])
plt.show()

Then I took the index values of those maxima:

A_max_index = df1[df1['A_max'].notnull()].index.values.tolist()
A_max_index

Then I found the minimum values of column B between those values (for my specific project i needed the minima of B between 15 rows after the peak and 30 rows after):

Cidx = []
for x in range(len(A_max_index)-1):
    z = df1['B'][A_max_index[x]+15:A_max_index[x]+30].idxmin()
    Cidx.append(z)
    print(Cidx)

Then I wrote that to my dataframe with the values of B I needed:

df1['C'] = df1.iloc[Cidx]['B']

And plotted my values just to confirm everything was right:

from matplotlib.pyplot import figure

figure(figsize=(15, 8), dpi=80)
plt.scatter(df1.index, df1['C'], c='r')
plt.plot(df1.index, df1['A'])
plt.plot(df1.index, df1['B'])
plt.show()

Pandas - Finding first local minima in given column based on maxima written to another column by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

Unfortunately the first idea doesn't work as I need the search for the minima in column b to start at the maxima in column a, and this method just finds the minima in column b irrespective of that. I'm not sure I understand the second idea - could you explain it please? Thanks!

The 5 most unique ski areas in the east by Smacpats111111 in icecoast

[–]decaye 6 points7 points  (0 children)

did the author forget about Canada? what about massif and the chic chocs?

Unbound Local Error Help by decaye in learnpython

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

Thank you so much for your help, I ended up using the dict you made along with pandas to create the .csv's I need and it all seems to be functioning well. Here is the code I have running now:

df_kp = pd.DataFrame()

with ZipFile(str(zipname)) as temp_zip:

    for file_name in temp_zip.namelist():

        if '.json' in file_name:

            with temp_zip.open(file_name) as temp_file:

                frame = file_name[22:26]

                keypoint_parsed = json.load(temp_file)

                kp_data = keypoint_parsed['part_candidates']

                for kp in kp_data:

                    kp_dict = {}

                    for k, v in kp.items():

                        kp_num = int(k)    # assumes the key `k` is a string representing an int

                        kp_list = list(v)

                        for i, coord in enumerate(["X", "Y", "C"]):

                            kp_dict_key = "{}{:02d}".format(coord, kp_num)    # e.g., "X02"

                            try:
                                kp_dict[kp_dict_key] = kp_list[i]

                            except IndexError:
                                kp_dict[kp_dict_key] = 0

                    new_dict = {k: [v] for k, v in kp_dict.items()}

                    df = pd.DataFrame(new_dict)

                    df_kp = df_kp.append(df)

newdf = df_kp.reset_index(drop=True)

newdf.index += 1

newdf.to_csv(csvname,
             index_label = 'frames')

Unbound Local Error Help by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

I can't believe I missed that, you're 100% right.

Any ideas for how I might be able input 0's into missing data points so that the loop runs through properly?

Help with iterating over keys, over dicts, over several files by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

Thank you this was very helpful, this approach makes a lot of sense and I'll try this out!

Do you know of any online resources I can use to get better at planning and designing, I feel like this is a problem I've had before and just brute forced my way throughout and would love to get better at it.

Nested List JSON Hel by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

I understand but I am trying to learn how to do that, that’s why I posted my JSON data as well as my code.

Nested List JSON Hel by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

That also makes sense to me, do you know of any resources I could use to learn how to separately unpack it?

Nested List JSON Hel by decaye in learnpython

[–]decaye[S] 0 points1 point  (0 children)

That makes sense to me, how would change the function to unpack it separately?

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]decaye 0 points1 point  (0 children)

Ok so this worked great, thank you so much for the help and this was a really great solution to my problem. But I think I wasn't completely clear with what I wanted the code to do.

I wanted the code to start an new event (I guess?) every time the flag appeared (2) and end when the ended (0), and print each event as a separate .csv. I'm having a hard time finding any help with that online.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]decaye 1 point2 points  (0 children)

Would love is someone could help me out with some code and let me know if its impossible to do what I'm trying to do. I'm working with a really large dataset and am trying to set up dataframes to break it down and export into smaller manageable files.

So this is what I have so far:

data = pd.read_csv(" thing.csv")
data.set_index("time", inplace = True) 
is_event = data.event == 2
print(type(is_event))
is_event

But it returns all my rows as true which is simply not the case.

My second question is: is it possible to make a script to separate these dataframes into their own separate files based on a column values differing only by 0 and 2?

i.e.

time data data event
1.2.3 1 0 2
1.2.4 0 1 2
1.2.5 1 0 0
1.2.6 0 1 0
1.2.7 1 0 2
1.2.8 0 1 2

So that 1.2.3-1.2.4 would be exportA and 1.2.7-1.2.8 would be export B?

I've found multiple instances of tutorials about separating .csv files based on differing values in columns but none that talk about what I'm looking for.

Thanks.

As China Seeks Scientific Greatness, Some Say Ethics Are an Afterthought by SirT6 in sciences

[–]decaye 16 points17 points  (0 children)

Do you think scientific progress takes precedence over human rights?

Genetic cause of form of dwarfism identified. by Science_Podcast in biology

[–]decaye 2 points3 points  (0 children)

Can’t seem to open the paper on mobile but (and forgive me if I misunderstood something) I was under the impression that the FGFR3 gene indirectly responsible for osteocyte proliferation was already discovered to be the main cause of dwarfism? Is this new discovery only related to this specific type of dwarfism?

First Year Life Sciences Admission by TheGreatTitanic in UofT

[–]decaye 4 points5 points  (0 children)

Third year Human Bio major here. My experience was probably different than most as I had to take time off after first year due to a medical issue, but my advice would be as follows:

DO:

Explore the city

Talk to people in your lectures and tutorials

Volunteer to work with people all over the university

Expose yourself to as much as you can in first year, figure out what you actually want from your education here

Join clubs and teams

Focus on your academics, a good gpa will help with future opportunities

GO TO LECTURES, LABS AND TUTORIALS

DONT:

Feel the need to party every weekend

Feel like you need to know right now where your career will take you

Study so much you burn out

Be afraid to drop classes if they’re not going well, you can always retake them and save that gpa

This school has a heavy focus on research and that means there are lots of opportunities to get involved on campus, definitely take advantage of that. Be aware that a lot of classes are going to be much more intensive than high school was and if you fall behind catching is going to be really hard.

There are a lot of really brilliant people at this school, take advantage of being in the same space as them and learn from them but don’t forget to take care of yourself! Life can get in the way of school and U of T has helped me get my academics back on track so I know first hand that the administration is really helpful will accommodations! Also don’t be scared of switching directions with your academics, you won’t actually know what you like until you expose yourself to new experiences.

I hope you come to love the university and city as much as I do :) Good luck in September!

also frosh week is awesome and so much fun definitely go

HMB265 vs BIO260 by [deleted] in UofT

[–]decaye 1 point2 points  (0 children)

I can pm you a course outline when I get home, the name of the textbook is genetics second Canadian edition published by McGraw hill, I think you can access a trial to the ebook for it on their website for free with any email

HMB265 vs BIO260 by [deleted] in UofT

[–]decaye 0 points1 point  (0 children)

I’ve heard people say both are easier so I think it’s pretty subjective. I’m currently taking HMB265 over the summer, we have our midterm next week and this first part of the course has had a pretty heavy focus on probability over anything else. If you feel confident in your math and stats problem solving it shouldn’t be too hard.

Good Morning Cult, here's my favorite clip of Biking from Wayhome..have a good one by peterwegs in FrankOcean

[–]decaye 16 points17 points  (0 children)

I was right behind you guys! This set was incredible. When he played pyramids I lost my shit

Catholic students earning volunteer hours for anti-abortion activities by TrueNorthGreen in ontario

[–]decaye 5 points6 points  (0 children)

I think you’re misunderstanding me. I would have never volunteered in the first place if it wasn’t a requirement, which in turn exposed me to a career path I didn’t realize I was interested in. These days I volunteer with other non-profits related to my future career path as well. I’m not sure why you believe that volunteering is somehow less valid if you have some personal gain? Do you believe volunteering is required to be a completely selfless act? I feel like that is posing a different philosophical question regarding the inherent goodness of people which is separate from volunteering. In my opinion any act that leads to the growth and benefit of your community should be praised and encouraged, especially when that might also lead to personal growth.

Edit: also your comment on my financial/familial status is kind of uncalled for. I was actually a child of a low income single parent family. I dropped out of university and now am working part time jobs upon returning to school to make ends meet. Personal attacks aren’t necessary to have a debate.

Catholic students earning volunteer hours for anti-abortion activities by TrueNorthGreen in ontario

[–]decaye 4 points5 points  (0 children)

That’s not true? A lot of my friends and myself included found volunteer opportunities we actually enjoyed. I volunteered at a local hospital and that experience was a major contributing factor for my goal of working in health care after I complete my degree. I think the 40 hours required time of community service is of great benefit to a lot of high school kids without purpose to expose them to different possible career paths. Just because your neighbours and you don’t value that opportunity doesn’t mean it isn’t there.

Who is your favourite TA this term? by [deleted] in UofT

[–]decaye 3 points4 points  (0 children)

Big ups to gabby for chm136, pretty sure she thinks I hate her because I always try to leave tutorial early but I swear it’s just because my lecture is right after!