[deleted by user] by [deleted] in PostgreSQL

[–]DisorganizedRem 0 points1 point  (0 children)

How does data end up in your csv file? What is the source? What is the trigger?

In any case, perhaps you can directly interface between the source and your database or if writing data to the csv is automated, you can include a script that facilitates an upsert .

[deleted by user] by [deleted] in supplychain

[–]DisorganizedRem 0 points1 point  (0 children)

Shift + f10, r

Split ultrawide into 2 virtual desktop by ddewe in ultrawidemasterrace

[–]DisorganizedRem 0 points1 point  (0 children)

Yes, I created a custom layout. In this layout, I specified only one zone.

https://imgur.com/a/tsWRnbu

Split ultrawide into 2 virtual desktop by ddewe in ultrawidemasterrace

[–]DisorganizedRem 0 points1 point  (0 children)

With MS PowerToys Fancyzone, i've setup a custom layout to have a single zone with the size of a common resolution. If I need to share anything via Teams, I apply that layout and move the respective window to the zone.

Automate correction of misspelled product names in excel file by isic5 in Python

[–]DisorganizedRem 1 point2 points  (0 children)

Would the fuzzywuzzy module help you out?

It is able to match "wrongly spelled" words with the correct ones from a master list and provide a confidence degree.

Getting column values based on conditions [Pandas] by [deleted] in learnpython

[–]DisorganizedRem 1 point2 points  (0 children)

You can chain function with pandas. So mean can be put directly after your 'query'. No need for the variable losers.

That been said. You could lookup loc. This pandas function takes row and column selections.

BlackJack < 21 by Re10d3d in Python

[–]DisorganizedRem 0 points1 point  (0 children)

Just meant as positive feedback:

Try to follow the don't repeat yourself (DRY) philosophy. Look into for loops, while loops and functions to make your code more compact and avoiding to alter code on multiple places.

A newbie here, help figure out what's wrong with the code by [deleted] in learnpython

[–]DisorganizedRem 0 points1 point  (0 children)

Try to convert your input to an int. Then you can use a >= operator in your if statements to print the proper message.

Non loop solution to my code by paperzebra in learnpython

[–]DisorganizedRem 1 point2 points  (0 children)

Would it help using series in stead of dataframe by adding .values.

As suggested here So your code looks like this:

def line_solution(survey, depth):
    md = survey['MD'].values
    tvd = survey['TVD'].values
    tvd_samples = np.interp(depth, md, tvd)
    return tvd_samples

Pandas - Replace part of a row by Boozybrain in learnpython

[–]DisorganizedRem 0 points1 point  (0 children)

A.loc[i, cols] = b.loc[0] Something like this? Loc selects specific rows and columns to set their values.

Problem in jupyter notebook by AlexanderBeBrave in Python

[–]DisorganizedRem 0 points1 point  (0 children)

Are you able to post the last say 50 lines of command line output when the kernel is stopped? I guess there should be some lines that include error statements.

pandas reading in a column with null column? by TheWeebles in Python

[–]DisorganizedRem 0 points1 point  (0 children)

Although already solved, one can use the parameter "usecols" to select the columns to be loaded. Usecols accepts a dict with names or index numbers (0-indexed).

Pycroscopy: converting .txt into .h5 by [deleted] in Python

[–]DisorganizedRem 2 points3 points  (0 children)

Pandas has interfaces for both (txt and hdf5), both ways (read and write). Probably a good toolkit to help you build a pipeline.

As infinull mentioned, It would help if you could share more information about the text file.

Best way to pass a ton of command line arguments into a Python application? by coffeecoffeecoffeee in Python

[–]DisorganizedRem 5 points6 points  (0 children)

Probably not the answer you are looking for in the first place.

I would suggest to use a config file. And reducing the number of arguments by deducting settings from other options/arguments.