Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Convert legacy print file to XLSX file
Post: read legacy print file output as xlsx excel file
Hi, I'm new to Python and have a project to create an excel file from a legacy print file.
After much Googling I've managed to tack together the following code:
import os, csv, re, xlsxwriter
import p... |
|
davidm |
General Coding Help |
1 |
1,816 |
Oct-17-2021, 05:08 AM |
|
|
Thread: Convert legacy print file to XLSX file
Post: Convert legacy print file to XLSX file
Hi, I have a project to convert a print file (attached) to xlxs format. I've created the Excel headers (attached) and would like to append the columns A - N from the print file to the Excel header fil... |
|
davidm |
General Coding Help |
1 |
1,816 |
Oct-10-2021, 01:08 PM |
|
|
Thread: numpy diagonal
Post: numpy diagonal
hi, need help with numpy.diagonal.
Using
grid.diagonal(0) for a 9 by 9 matrix
I can see the diagonal [0,0} to [8,8}.
How do I see the diagonal [0,8] - [8,0]?
Also how do I display cell row and column... |
|
davidm |
Data Science |
1 |
1,798 |
Aug-01-2020, 01:53 PM |
|
|
Thread: display single elements in array
Post: RE: display single elements in array
Thanks for this,
much appreciated |
|
davidm |
General Coding Help |
3 |
2,111 |
Jul-26-2020, 07:32 AM |
|
|
Thread: display single elements in array
Post: display single elements in array
Hi, I have a 9 by 9 numpy array how do I display the 4 corner cell values:
Top left, top right, bottom left, bottom right.
Thanks |
|
davidm |
General Coding Help |
3 |
2,111 |
Jul-26-2020, 12:02 AM |
|
|
Thread: Explain: x0 = (x//3)*3
Post: RE: Explain: x0 = (x//3)*3
Thanks Dean,
Searched for Python symbol "//" but wasn't successful |
|
davidm |
General Coding Help |
3 |
1,923 |
Jul-23-2020, 06:14 PM |
|
|
Thread: Explain: x0 = (x//3)*3
Post: Explain: x0 = (x//3)*3
Hi,
I'm following this youtube code for a sudoku solver using python.
In the following piece
def possible(y,x,n):
global grid
for i in range(0,9):
if grid[y][i] == n:
retu... |
|
davidm |
General Coding Help |
3 |
1,923 |
Jul-23-2020, 05:40 PM |
|
|
Thread: how to run a series of py scripts
Post: RE: how to run a series of py scripts
Thanks Larz, went of and Googled your suggestion, found:
https://stackoverflow.com/questions/2459...sing-batch
Will include a log file to keep track of success or fail of each step and will read that ... |
|
davidm |
General Coding Help |
2 |
1,970 |
Apr-10-2020, 02:38 PM |
|
|
Thread: how to run a series of py scripts
Post: how to run a series of py scripts
Hi Just starting out on the python path and would like to know the best way to run all the 4 steps below in one operation (batch file in my day)
1. pip3 install tensorflow pandas numpy matplotlib yah... |
|
davidm |
General Coding Help |
2 |
1,970 |
Apr-10-2020, 11:19 AM |
|
|
Thread: error installing requests_html
Post: RE: error installing requests_html
Hi Snippsat, tried running your code and get this error
[inline]
soup = BeautifulSoup(browser.page_source, 'lxml')
File "C:\Users\david\PycharmProjects\yahoo-finance\venv\lib\site-packages\bs4\_... |
|
davidm |
Web Scraping & Web Development |
4 |
3,934 |
Mar-06-2020, 12:01 AM |
|
|
Thread: error installing requests_html
Post: RE: error installing requests_html
Thanks Snippsat
Super helpfull
Did succeed to install requests_html using pip3 install requests_htmlfrom the command prompt |
|
davidm |
Web Scraping & Web Development |
4 |
3,934 |
Mar-05-2020, 01:52 AM |
|
|
Thread: error installing requests_html
Post: error installing requests_html
Hi, Trying to run: "pip install requests_html" and getting this error
Executed ommand: pip install libxml2-python3
Error occurred: Non-zero exit code (1)
Running Python 3.8 on Windows 10 and want to ... |
|
davidm |
Web Scraping & Web Development |
4 |
3,934 |
Mar-04-2020, 05:30 PM |
|
|
Thread: How to avoid open and save a url every time I run code
Post: RE: How to avoid open and save a url every time I ...
How do I change this this editor to ltr - without leaving the country?
Thanks for your reply, sorry for confusing subject line.
Is there a way to save the url content to a variable and pass that varia... |
|
davidm |
General Coding Help |
4 |
2,661 |
Mar-03-2020, 06:15 PM |
|
|
Thread: How to avoid open and save a url every time I run code
Post: How to avoid open and save a url every time I run ...
Hi I'm new to Python, BeautifulSoup and PyCharm, like to know how to write code so I don't have run this every time I run a test
import requests
from bs4 import BeautifulSoup
url = 'https://finance.... |
|
davidm |
General Coding Help |
4 |
2,661 |
Mar-03-2020, 02:20 PM |
|
|
Thread: check how many times an item appears in list
Post: RE: check how many times an item appears in list
After Googling around since my last post I finally came up with this solution:
import pandas as pd
df = pd.read_csv("Lottery-numbers-only.csv")
print(pd.value_counts(df.values.flatten())) |
|
davidm |
General Coding Help |
8 |
5,031 |
Dec-29-2018, 07:49 PM |
|
|
Thread: check how many times an item appears in list
Post: RE: check how many times an item appears in list
Hi, I'm still trying to get value_counts from multiple columns of a csv file this code:
import pandas as pd
df = pd.read_csv("lotto-0807-1218.csv")
print(df['Num 1'].value_counts().to_frame())Prints t... |
|
davidm |
General Coding Help |
8 |
5,031 |
Dec-29-2018, 12:00 PM |
|
|
Thread: upload from local disk
Post: upload from local disk
How do I upload a file from my local disk? |
|
davidm |
Board |
1 |
1,925 |
Dec-24-2018, 02:35 PM |
|
|
Thread: make a frequency table
Post: RE: make a frequency table
My problem is getting a count of the values.
Thanks |
|
davidm |
General Coding Help |
6 |
3,614 |
Dec-23-2018, 12:02 PM |
|
|
Thread: make a frequency table
Post: RE: make a frequency table
Hi Barun, been struggling with this, having trouble getting my head round Python.
Maybe you can give me a little more help.
Here's an example of the csv input file:
Str, N1, N2, N3, N4, N5, N6
Sag, 1... |
|
davidm |
General Coding Help |
6 |
3,614 |
Dec-23-2018, 11:34 AM |
|
|
Thread: make a frequency table
Post: RE: make a frequency table
Thanks for this Buran, I already have a csv file going back a few years, so presumably I can forget collections.defaultdict. |
|
davidm |
General Coding Help |
6 |
3,614 |
Dec-20-2018, 01:30 PM |