Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Formatting
Post: Formatting

I'm trying to figure out how to format only A2:A9, and C2:C9, my header has it's own formatting. I wrote this line of code and would like to use it to format A2:A9, and C2:C9 but I'm not sure how to...
Kristenl2784 General Coding Help 0 980 Aug-04-2020, 05:09 PM
    Thread: Center align
Post: Center align

Hello, Is there a way to center align ws3 cells as the values from ws1 get written into the ws3? ws3[f'A{i+2}']=ws1['A1'].value[28:] ws3[f'D{i+2}']=ws1['B4'].value ws3[f'E{i+2}']=ws1['D4'...
Kristenl2784 General Coding Help 1 1,966 Aug-03-2020, 04:09 PM
    Thread: Float Formatting
Post: RE: Float Formatting

(Jul-30-2020, 03:26 PM)bowlofred Wrote: I don't understand what "4+22.92" is supposed to mean. As it doesn't look like a standard numeric format, could you explain how to get there? Do you just wa...
Kristenl2784 General Coding Help 3 1,750 Jul-30-2020, 04:39 PM
    Thread: Float Formatting
Post: Float Formatting

Hello, I'm trying to format a float and I can't seem to figure it out. I've been able to make the float only have two decimal places. But I need to format it a little more so that it shows as 4+22....
Kristenl2784 General Coding Help 3 1,750 Jul-30-2020, 02:45 PM
    Thread: TXT to Excel columns
Post: TXT to Excel columns

Hello, I have a txt file, so when I open it, everything is under 1 column. I want to convert to excel and break the data up and only use column 0, and 9. My code almost works, but the data I'm gett...
Kristenl2784 General Coding Help 0 1,267 Jul-29-2020, 05:16 PM
    Thread: os.list dir not working
Post: RE: os.list dir not working

(Jul-29-2020, 02:50 PM)deanhystad Wrote: To debug a problem like this the first thing I would do is verify I am getting a list of files. input_dir = 'C:/Users/work/comparison' for file in os.listdir...
Kristenl2784 General Coding Help 8 10,045 Jul-29-2020, 03:24 PM
    Thread: os.list dir not working
Post: RE: os.list dir not working

(Jul-29-2020, 02:00 PM)Axel_Erfurt Wrote: (Jul-29-2020, 01:41 PM)Kristenl2784 Wrote: C:\\Users\\\work\\comparison 3 x backslash try C:/Users/work/comparison Python lets you use OS-X/Linux style...
Kristenl2784 General Coding Help 8 10,045 Jul-29-2020, 02:14 PM
    Thread: os.list dir not working
Post: os.list dir not working

Hello, For some reason this isn't working, it shows files list as 0 []. I have 6 .xlsx files in the input_dir. If I put the .xlsx file where the script is it will work, but I need these .xlsx files i...
Kristenl2784 General Coding Help 8 10,045 Jul-29-2020, 01:41 PM
    Thread: string match
Post: RE: string match

I figured this counts4=stops3['Train']==(string2) counts5=counts4[counts4==1].count()
Kristenl2784 General Coding Help 1 1,446 Jul-28-2020, 03:14 PM
    Thread: string match
Post: string match

Hello, This is just a portion of the code, I thought I would only cut out what I'm currently working on. This part of the code is inside a for loop that loops through a lot of excel files. I'm ha...
Kristenl2784 General Coding Help 1 1,446 Jul-28-2020, 01:20 PM
    Thread: Skipping Strings
Post: Skipping Strings

Hello, There is more to this script but I cut out the portion I am currently working on. This is part of a for loop, there're a lot of excel files to loop through. Where the if statement starts is...
Kristenl2784 General Coding Help 0 1,507 Jul-27-2020, 06:01 PM
    Thread: Exact Match
Post: RE: Exact Match

(Jul-24-2020, 11:48 PM)snippsat Wrote: Should tell that you use Pandas not all is familiar with the syntax,and if give a working code example is easier to help. In regex can use \b for a exact word ...
Kristenl2784 General Coding Help 2 2,844 Jul-26-2020, 03:29 PM
    Thread: Exact Match
Post: Exact Match

Hello, The first line of code is supposed to find string A180, and shift down 9 rows and grab that value. My problem is, is that I also have A180X inside this file, so It's not grabbing the correct ...
Kristenl2784 General Coding Help 2 2,844 Jul-24-2020, 03:29 PM
    Thread: def function
Post: RE: def function

I figured this out by using shift(9)
Kristenl2784 General Coding Help 10 3,698 Jul-23-2020, 06:58 PM
    Thread: def function
Post: RE: def function

(Jul-23-2020, 05:26 PM)jefsummers Wrote: Still a problem in your if statement - whether true or false it just progresses to the next line and assigns the value to TA. Personally, I would read the s...
Kristenl2784 General Coding Help 10 3,698 Jul-23-2020, 05:55 PM
    Thread: def function
Post: RE: def function

(Jul-23-2020, 01:06 AM)jefsummers Wrote: If that gets the answer you want, certainly use it. That is not the code you originally posted, and I would still point out the "style" issues with variable ...
Kristenl2784 General Coding Help 10 3,698 Jul-23-2020, 11:40 AM
    Thread: def function
Post: RE: def function

(Jul-22-2020, 07:02 PM)jefsummers Wrote: But that is also the name of your function. In some languages you define your return value by setting it to the function name. That is not true with Python. ...
Kristenl2784 General Coding Help 10 3,698 Jul-22-2020, 08:12 PM
    Thread: def function
Post: RE: def function

(Jul-22-2020, 06:31 PM)jefsummers Wrote: There are a number of issues. First to answer your question - a function is a piece of code that performs a task. You can think of a function as something yo...
Kristenl2784 General Coding Help 10 3,698 Jul-22-2020, 06:36 PM
    Thread: def function
Post: def function

Hello, I don't really understand the def() function so I'm not really sure what I need to put at line def. Right now nothing is printing out when I run this portion of the script. If I remove def an...
Kristenl2784 General Coding Help 10 3,698 Jul-22-2020, 06:06 PM
    Thread: Find string return different string
Post: Find string return different string

Hello, I need to find the string inside TFile, and once the string is located I need to return the string 9 cells below it. TFile contains only one column. I'm not sure if I'm on the right path her...
Kristenl2784 Homework 2 1,538 Jul-22-2020, 02:13 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020