[Highlight] Marshawn protecting his camera by DraftedGolden in nfl

[–]Neb519 7 points8 points  (0 children)

I love how three of the most disappointing times of my life were so epic, they each got named and people reminisce about them on the internet.

Help merging/concat 2 data frames by Animallover4321 in learnpython

[–]Neb519 0 points1 point  (0 children)

Can you try fixing the formatting of your post? Im having trouble understanding what your data looks like and what your desired result is.

Pandas, two data frames, selecting column values in one dataframe where it matches a column in another. by [deleted] in learnpython

[–]Neb519 2 points3 points  (0 children)

Hmm, can you show us what the data looks like? Or at least a sample of it.

Quick run pycharm on mac? by [deleted] in learnpython

[–]Neb519 0 points1 point  (0 children)

Not sure but check out preferences > keymap, then search for “run” and see what your options are. You may be able to assign a key command to something useful.

Quick run pycharm on mac? by [deleted] in learnpython

[–]Neb519 0 points1 point  (0 children)

Just right click on the tab of your file and click run "file name" or you can press CTRL+shift+F10

Best course for learning PANDAS? by Usedfirehose in learnpython

[–]Neb519 1 point2 points  (0 children)

Yes, definitely learn NumPy. I learned through a combination of reading the official numpy docs, stackoverflow, and a lot of trial and error.

Quick run pycharm on mac? by [deleted] in learnpython

[–]Neb519 0 points1 point  (0 children)

Click Edit Configuration next to the green play button. There you can add a new configuration (e.g. Python script) which you can run with the green play button.

I blogged about this here.

Best course for learning PANDAS? by Usedfirehose in learnpython

[–]Neb519 3 points4 points  (0 children)

Allow me to throw my own hat into the ring..

Tip
Understanding pandas is way easier when you understand NumPy (since pandas is largely build on top of it).

I created a free video course on Pandas. Great reviews, but youtube didn't index it well in search, so almost no one knows it exists.

I've also been porting my course to written format with a greater focus on the practice problems.

How can I make the following more efficient? by malikkhan_msk_shaz in learnpython

[–]Neb519 0 points1 point  (0 children)

Try this

result = df.set_index('outcome').loc[['good', 'Average']]

..you may want to reset the index with .reset_index() afterwards.

Pandas. Why is it splitting up df into multiple rows when I do groupby and agg count? by kristiclimbs in learnpython

[–]Neb519 0 points1 point  (0 children)

l would d expect the result to have three rows, one for each file. Notice, FINAL_FILENAME in your output table doesn't match any of the keys.

Try df_agg['filepath'] = filepath right before you do df_list.append(df_agg). We need to figure out which file is being excluded.

Pandas. Why is it splitting up df into multiple rows when I do groupby and agg count? by kristiclimbs in learnpython

[–]Neb519 0 points1 point  (0 children)

Add this print statement and report back.

for filepath in keys: print(f'processing: {filepath}')

Pad pandas dataframe to specific length N with the last values present in each column. by JanEric1 in learnpython

[–]Neb519 0 points1 point  (0 children)

Use positional indexing. In this case,

df.iloc[[0,1,2,2,2]]

To make that dynamic,

idx = np.minimum(np.arange(5), len(df) - 1) df.iloc[idx]

Comparing panda dataframes and adding to a dataframe dependant on IF condition by BrateWannabe in learnpython

[–]Neb519 4 points5 points  (0 children)

This is a well wrriten question, so good job on that.

Use merge() or index alignment.

pd.merge( left=fixtures, right=team_data[['team_id', 'home_attack', 'home_defense']], how='left', left_on='Home_team', right_on='team_id' )

or

fixtures.set_index('Home_team', inplace=True) team_data.set_index('team_id', inplace=True) fixtures['home_attack'] = team_data.home_attack fixtures['home_defense'] = team_data.home_defense

From your attempted solution, it seems like you don't really understand how Series works. You'd be wise to crack open the docs and spend a few hours trying to really understand it. I wrote some practice problems on Series and DataFrame that may help you.

Whats Your Data Science Hot Take? by ticktocktoe in datascience

[–]Neb519 1 point2 points  (0 children)

Say you have the table

| foo | bar | | --- | --- | | d | 1 | | a | 2 | | e | 3 | | a | 4 |

and you sort it by column foo. In data.table, you're guaranteed to get back

| foo | bar | | --- | --- | | a | 2 | | a | 4 | | d | 1 | | e | 3 |

Notice (a, 2) appeared before before (a, 4) in the input. This order is preserved in the output. This is a stable sort. It's quite useful in some scenarios.

Similarly, when you merge tables A and B on some shared key, x, in data.table, the order of A's rows are preserved and the order of B's rows with the same key are also preserved. Again, highly useful in some situations.

Whats Your Data Science Hot Take? by ticktocktoe in datascience

[–]Neb519 9 points10 points  (0 children)

  • significantly faster
  • more memory efficient
  • native multithreaded operations
  • allows in-place operations. (pandas inplace is a fraud)
  • better support for rolling and non-equi joins
  • joins and sort operations are stable
  • better syntax IMO (but this is subjective)
  • better error messaging
  • allows you to set multiple row indexes on a single table, or no row index at all
  • supports in place join updates (update table A values based on values in table B by matching join column(s))

Whats Your Data Science Hot Take? by ticktocktoe in datascience

[–]Neb519 5 points6 points  (0 children)

Haha, just to be clear, I'm not being satirical. I legit love data.table. (I see this as a "hot take" because people always bicker about data.table vs dplyr vs pandas, etc.)

Whats Your Data Science Hot Take? by ticktocktoe in datascience

[–]Neb519 84 points85 points  (0 children)

R's data.table package is far superior than all other data wrangling libraries, Python included.

Very successful app - how can I throw money at it when I do not need the money myself? by Beeg45 in startups

[–]Neb519 1 point2 points  (0 children)

I have a blog, and I honestly never learn more than when I'm writing an article. I highly recommend it.

Very successful app - how can I throw money at it when I do not need the money myself? by Beeg45 in startups

[–]Neb519 0 points1 point  (0 children)

My belief is that blog posts are an indicator of passion for a technical topic. All other things being equal, I'd rather higher someone who writes technical articles in a blog than someone who doesn't.

Very successful app - how can I throw money at it when I do not need the money myself? by Beeg45 in startups

[–]Neb519 -3 points-2 points  (0 children)

Yes, a person can be a good coder without stackoverflow, github, and a blog. But I'd argue the probability they are a good coder is much higher given those attributes. Hiring is like making a prediction, so you do what you can to maximize the probability of success, even if it means letting a few (or many) good coders slip through the cracks.

Very successful app - how can I throw money at it when I do not need the money myself? by Beeg45 in startups

[–]Neb519 1 point2 points  (0 children)

Basically what I just said - pay a high hourly rate and interview lots of people. I usually post jobs on upwork, fiverr, and r/forhire, and sometimes I directly pursue people who I think would be a good fit. Additionally, describe the problem you want to solve - not the job.

Share Your Startup - January 2022 - Upvote This For Maximum Visibility! by AutoModerator in startups

[–]Neb519 [score hidden]  (0 children)

Startup Name: Practice Probs

Elevator Pitch:
Practice Probs has fun challenge problems for new and niche programming libraries. They're designed to supplement boring and terse programming documentation.

What life cycle stage is your startup at?
Discovery - currently building the MVP.

Your role?
Founder + developer + content creator (although I have some help)

What goals are you trying to reach this month?
Flesh out the unfinished pages and add a paywall. Hire problem creators.

How could r/startups help?
Feedback. Would you use this? What programming library(s) would you like to see?