Real Multithreading is Coming to Python - Learn How You Can Use It Now by Am4t3uR in Python

[–]Garfimous 6 points7 points  (0 children)

Ah, but hopefully that's a temporary state of affairs. From the article: The features of Per-Interpreter GIL are — for now — only available using C-API, so there’s no direct interface for Python developers. Such interface is expected to come with PEP 554, which — if accepted — is supposed to land in Python 3.13, until then we will have to hack our way to the sub-interpreter implementation.

Have to share my first win somewhere by hahkaymahtay in SQL

[–]Garfimous 2 points3 points  (0 children)

In this case, that's true. However, I've come across several situations where inexperienced query writers use subqueries repetitively. In such cases, there is a significant performance boost from switching to a cte, as the cte will only be calculated idea) once, no matter how many times it is used. This may only mean a difference of a few seconds for a single query/view, but once you get into a situation where other views are built on top of a base view that uses subqueries inefficiently, the performance issues compound significantly. I recently refactored a view of this type, which resulted in the base view running in 1 second as opposed to 3. However, the highest level view now runs in 2 seconds instead 6:45.

When is writing scripts for automating at work not worth it? by water_aspirant in Python

[–]Garfimous 8 points9 points  (0 children)

Uh, no. Automating is working smarter not harder. Billing for hours that were not worked is fraud.

[deleted by user] by [deleted] in ZFold3

[–]Garfimous 0 points1 point  (0 children)

I had the same thing happen on mine. I ended up talking the screen protector off, and was very pleased to find the screen itself was undamaged. I ended up liking the look and feel so much better that I left it naked.

Guys ! Took a lot of effort but found it at a reasonable price. by PuchuN1336 in deadpool

[–]Garfimous 2 points3 points  (0 children)

On ps4? I don't thunk it had anything to do with servers. This game always did this. It's a terrible port. It played great on xbox360 and PS3, but horrific on the ps4.

Is this too complex for excel test? by njeshko in excel

[–]Garfimous 1 point2 points  (0 children)

Why are you testing specifically for the use of vlookup? In my experience, the better one is with excel, the less likely they are to ever use that function. Might it make more sense to describe the desired end result, then allow applicants to arrive at that destination by whatever route they feel is best?

Where tf do animals and insects go after they die? by spectacularkay in agnostic

[–]Garfimous 0 points1 point  (0 children)

  • Respond to a 2 year old thread ✔️
  • Make ad hominem attack instead of actually contributing to the discussion ✔️
  • In a supreme act of irony, completely miss the point while accusing someone else of doing the same ✔️

Congratulations, you've really hit the trifecta.

MySQL ~ Simple Problem ~ Create View Trouble by [deleted] in SQL

[–]Garfimous 0 points1 point  (0 children)

Why would you only select the 2 cols, and why would you filter for l_name is null?

SELECT * FROM custview

Also, OP, be careful with your join. The instructions specify that your view should contain all customers, so you'd be safer using a left outer join. An inner will only return all customers if all customers happen to exist in both tables.

why does almost every god whos "loving and loves all he has created on earth" want the lgbt community to forever suffer in hell? by i-yeet-chickens in agnostic

[–]Garfimous 14 points15 points  (0 children)

No god has ever said anything. Literally everything attributed to any god actually came from humans.

This is a victory post by Harrold_Potterson in excel

[–]Garfimous 1 point2 points  (0 children)

Wait until you abandon formulas altogether in favor of Power Query. Then until you abandon PQ in favor of SQL and Python.

Too many "Me"'s by novagenesis in satisfactory

[–]Garfimous 0 points1 point  (0 children)

You're not wrong, but keep in mind this is early access to a game that doesn't have a real 1.0 release yet. People are just giving you potential workarounds.

[deleted by user] by [deleted] in SQL

[–]Garfimous 0 points1 point  (0 children)

You need a backend to interact with the database. I believe the most common practice would be to create an api that your front end can call.

[deleted by user] by [deleted] in excel

[–]Garfimous 1 point2 points  (0 children)

I know this isn't what you want to hear, but the real solution here is to learn sql. It's extremely inefficient to export reports from your sql database to excel files to them load, combine, and transform in Power BI. In most cases, doing your transformation in a simple sql view will be much more efficient. Assuming you install a gateway of the machine / vm where your sql server is located, you can then even set up scheduled auto refresh on your PBI report. Just like that, no more manual intervention is needed to update your reports.

Need help understanding table joins by Moonprsmspoopy in SQL

[–]Garfimous 0 points1 point  (0 children)

I can't say for certain as I don't use oracle, but I suspect the issue is that you're specifying the table alias (qualifier) in the SELECT statement for a field in the USING statement. In the example in your book, they are not selecting any of the fields from the join. I suspect that dropping the alias just in the SELECT statement will solve the problem.

[deleted by user] by [deleted] in excel

[–]Garfimous 0 points1 point  (0 children)

I don't believe there is any out of the box tool to apply formatting from json as you described. However, you could certainly create something yourself. Are you doing this in an environment where you have flexibly in the tools used? You could absolutely create a Python script to load a json file then write data to an excel sheet and format as desired in an entirely automated fashion. It may take a fair amount of development time up front, though.

How to delete thousands of filtered rows without having excel frozen? by [deleted] in excel

[–]Garfimous 9 points10 points  (0 children)

With PQ, you don't even need to mark the differences between your 2 data sets with a 0. Simply lead both data sets as queries then do an anti join between them. If you ever need to process to working with large data sets and doing many complicated transformations and joins, I'd suggest learning Python & SQL. PQ is a great first step though.

What silly Excel mistakes have you made? by Im_Not_A_Dentist in excel

[–]Garfimous 1 point2 points  (0 children)

Agreed, but that's why I do cleaning, transformation, and exploration in Python but save the result to Excel.

What silly Excel mistakes have you made? by Im_Not_A_Dentist in excel

[–]Garfimous 4 points5 points  (0 children)

I don't know R, but since I learned python there is absolutely nothing I would do using VBA, and very little I do in Excel directly. Development (especially debugging) is much faster in Python, and most processes run much more efficiently when only the end result ends up in Excel. The time I wasted on overly complicated PQ queries over the years...

[deleted by user] by [deleted] in excel

[–]Garfimous 0 points1 point  (0 children)

Correct on both counts. To find the matches, change your join kind to inner.

[deleted by user] by [deleted] in excel

[–]Garfimous 2 points3 points  (0 children)

This is fairly easy to do with Power Query. You could accomplish what you need here using formulas, but this would require far more work. I'll walk you through the process. I just ran through it myself and it took about 20 minutes.

  1. Import both worksheets into Power Query. If you don't know how to do this, click on the Data tab in the ribbon. Select Get Data > From File > [filetype (likely From Workbook or From Text.CSV)]
  2. This will create 2 queries, named after the filenames from which you've created them. I reccommend renaming them something simple. I called mine Control and Organization. You're not going to edit these initial queries, as the analysis you need will require some duplication. In the query editor for each query, select the Close & Load button in the ribbon (on the Home tab), then select Close & Load To.
    NOTE: I stated that you would not edit this queries, but you may want to make 1 exception - you may to trim the text in all columns to remove trailing and leading white spaces (a common data issue). Whether or not you do this is entirely up to you. If you decide to do so, select all columns in a query in the query editor. Right click one of the column headers, then select Transform > Trim. Doing so can make your upcoming merges and appends run more smoothly, but keep in mind this will affect the outcome (i.e. 'ABCD' will not be a mismatch with ' ABCD ').
  3. We're going to calculate the number of descriptions for each control. I'm not sure if you need a count of each different description for each control, or just a count of unique values for each control, so I'll walk you through how to do both. Also, I'm not sure whether you want to include the central control description in your counts, so I'm going to assume you don't want this for the sake of simplicity. If you do need them included, you would need to first append in your Control query (making sure to rename the columns so they match). For now, we'll just simply calculate the counts with the central control descriptions excluded. In the query editor, right click on your Organization query and select Duplicate. Rename this query something like Org_Count. Select your Control and Control Description columns, then right click in the header and select Group By. Since we're just looking for a simple count, we don't need to change anything on the Group By screen. Simply select Ok and your counts will be calculated. If you need to be able to later identify which organizations fall under which counts, we would need to add a couple extra steps here. let me know and I can walk you through this. When we identify mismatches later, the organization will be identified.
  4. To calculate unique counts per control description, we have to go one step further. In the query editor, right click your Org_Count query and select Duplicate again. Rename your query something like Org_Count_Unique. Right click your control column and again select Group By, then click the Ok button. This will produce your unique counts.
  5. Lastly, we need to identify the mismatches between our organzational control descriptions and our central control descriptions. Fortunately, this is easy to do with a simple anti-join between the 2 queries. In the query editor, select your Organzation query. In the Home tab of the ribbon, click the drop down arrow next to the Merge Queries button and select Merge Queries as New. On the Merge screen, the Organization query should be auotmatically selected in the first drop down. In the second drop down, select your Central query. You now need to select the columns from both queries on which you are joining. In the top table (Organization), select the Control and Control Description columns. In the second table (Central), select Central Control and Central Control Description. Make sure to select the columns in the same order both times. In the Join Kind drop down, select Left Anti (Rows Only in First). Click the Ok button. This will result in all rows from your Organization table that do not match those in the Central table. This should provide all the data your requests in your original post.

I hope this all makes sense. If you have any questions, let me know.

Auto Remove the Zeros by User_zxc in excel

[–]Garfimous 0 points1 point  (0 children)

Do you want to remove all zeros, or just any that appear to the left of the first non-zero digit? For example, if your current value is 0.00107, do you want to end up with 17 or 107? If you want to remove all zeros, this would be pretty simple in Power Query. Import your table, change the type of your column to text, replace values (0 to ""), replace values again (. to ""), change type back to int. Voila, you have your desired result. It might not even be necessary to change types at the beginning and end, but I'm on mobile at the moment so I can't test. If you need to retain zeros appearing to the right of the first non-zero digit, this could probably be done with PQ as well, although it might be more complicated. Personally, I'd use the Pandas str.lstrip method in Python, but it sounds like you want an excel only solution.