|
Necrobama posted:Part of me is screaming at me "JUST LEARN POWERSHELL!"? Is that part right? No. I am normally a powershell evangelist, but python/pandas is the right tool for the job here.
|
# ¿ Mar 30, 2023 15:12 |
|
|
# ¿ May 15, 2024 11:02 |
|
When I was doing something similar, I don't remember having to do anything with actual SQL statements, pandas did it all for me. Are you just loading the csv's into the tables as is? df.to_sql should create and insert for you The only real issue I ran into was managing types, and the solution I went with was to have a dict with a list of column names and types. Would require knowing that info ahead of time.
|
# ¿ Mar 30, 2023 15:18 |
|
Necrobama posted:
the dtype argument lets you specify column types and take a dict
|
# ¿ Mar 30, 2023 15:34 |
|
vs code has a whole remote workspace thing where you can point it at any vm or container with ssh
|
# ¿ Apr 1, 2023 22:01 |
|
that's something I end up doing a few times a year at work use python to collect and sanitize your data, then deliver in whatever form your audience is more likely to use sadly for me that is often power bi
|
# ¿ Apr 9, 2023 16:22 |
|
Foxfire_ posted:Does human editable mean 'editable by a programmer' (use something standard like everyone else has said) or 'editable by Bob from Marketing who needs explicit very friendly error messages on typos'? code:
|
# ¿ Nov 7, 2023 16:21 |
|
Unless you have anything that looks like a date string in your cells. I used an open source csv editor once a long time ago, it did not have a smaller footprint than excel, and was worse in almost every way. I feel like if excel is not going to work, the best option is to load it into a dict or a dataframe, do what you need to do in a jupyter notebook, then generate a new csv.
|
# ¿ Nov 7, 2023 18:13 |
|
tangentially related, is there a good way to generate a requirements.txt that only has what is being imported in my working directory and not everything in my entire environment
|
# ¿ Jan 22, 2024 18:54 |
|
necrotic posted:pip freeze doesn’t look at your imports, just what’s installed. The point is to have _every_ dependency pinned. I understand that which is the entire point of my question.
|
# ¿ Jan 22, 2024 22:06 |
|
CarForumPoster posted:Requirements.txt is usually made by pip freeze or by hand as you install stuff so you can maintain orders and versions. What’s being imported doesn’t necessarily have 1:1 naming with the package name on pip. My issue is that my local workstation has a million unrelated things installed and I never did a good job of managing venvs. So when I write a thing to be deployed and need a requirements.txt I have to do it by hand right now and it's annoying.
|
# ¿ Jan 22, 2024 22:08 |
|
just use pandas
|
# ¿ Jan 26, 2024 18:25 |
|
simple python envs work fine in windows depending on what you're doing some packages may not work cleanly that being said, my daily driver is a windows machine but I do 90% of my work in WSL or a docker container.
|
# ¿ Feb 13, 2024 16:23 |
|
Doing your build in docker is not a terrible idea except for the fact that windows containers are horrible.
|
# ¿ Feb 14, 2024 17:47 |
|
should be able to use capture groups: https://docs.python.org/3/library/re.html#re.Match.group
|
# ¿ Mar 5, 2024 01:50 |
|
Tacos Al Pastor posted:Thats awesome, but I dont want to store them in a tuple but rather a list. iterate the lines, if it does't match it returns None, if it does it returns group(0) as a string, append to your list
|
# ¿ Mar 5, 2024 04:13 |
|
flask binds to 127.0.0.1 by default, you can change that by using the --host flag
|
# ¿ Mar 13, 2024 13:43 |
|
fwiw I absolutely hate the tone of parts of the foundation documentation
|
# ¿ Mar 19, 2024 14:41 |
|
|
# ¿ May 15, 2024 11:02 |
|
Yes, use playwright https://playwright.dev/python/
|
# ¿ Apr 2, 2024 15:40 |