Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Seaborn heatmap intervals
Post: Seaborn heatmap intervals

Hi all, Im creating a heatmap using seaborn in python, and I want to set the intervals between the minimum value and maximum value to be 0.05. right now, my problem is that there are some lines that s...
ranbarr Homework 0 1,867 Aug-09-2021, 11:04 AM
    Thread: Modifying the axis ticks from words to lines
Post: Modifying the axis ticks from words to lines

Hi, Im trying to modify the yticks at my heat map from words to lines. thats my code: with open('heat1.csv', 'r', encoding='mac_roman', newline='') as csvfile: df = pd.read_csv(csvfile, sep=',') ...
ranbarr Homework 0 1,073 Aug-04-2021, 12:34 PM
    Thread: sum all ints of the same line
Post: RE: sum all ints of the same line

(Jun-06-2021, 07:52 PM)ranbarr Wrote: hi, Im trying to calculate the mean of a mutation level of chromosomes. Im caculating each chromosome mutation level with this line: formula = ((alt_minus+alt_...
ranbarr Homework 1 1,739 Jun-06-2021, 07:54 PM
    Thread: sum all ints of the same line
Post: sum all ints of the same line

hi, Im trying to calculate the mean of a mutation level of chromosomes. Im caculating each chromosome mutation level with this line: formula = ((alt_minus+alt_plus)/(alt_minus+alt_plus+ref_minus+ref_...
ranbarr Homework 1 1,739 Jun-06-2021, 07:52 PM
    Thread: Calculate mean only for match strings
Post: RE: Calculate mean only for match strings

I tried to go to another direction and this is it: def vcfToDict(file): if isVCF(file) == True: chromosome = {} else: return ValueError("Invalid VCF Format") with open(file...
ranbarr Homework 1 2,670 Jun-01-2021, 10:03 AM
    Thread: Using re to find only uppercase letters
Post: RE: Using re to find only uppercase letters

(May-28-2021, 06:58 PM)nilamo Wrote: Something still seems off, as that regex won't match the string.>>> import re >>> test = 'ChrX 74226540 T t 50 ....
ranbarr Homework 6 3,295 May-31-2021, 03:19 PM
    Thread: Calculate mean only for match strings
Post: Calculate mean only for match strings

Hi, I have this assignment in which I have a file that contains alot of chromosed that I need to calculate for each one of them the mutation level. The problem is that each chromosome can appear sever...
ranbarr Homework 1 2,670 May-31-2021, 03:17 PM
    Thread: Using re to find only uppercase letters
Post: RE: Using re to find only uppercase letters

(May-27-2021, 09:21 PM)nilamo Wrote: Is there something that isn't shown? This shouldn't have matched: ChrX (your regex only looks for lowercase "chr") I'm assuming that's the same reason the lower...
ranbarr Homework 6 3,295 May-28-2021, 12:49 PM
    Thread: Using re to find only uppercase letters
Post: RE: Using re to find only uppercase letters

(May-27-2021, 06:53 PM)perfringo Wrote: What is exact meaning of 'find a string with the letters ATGC only in uppercase'. Does it mean 'determine whether line contains word constructed only from let...
ranbarr Homework 6 3,295 May-28-2021, 12:48 PM
    Thread: Using re to find only uppercase letters
Post: Using re to find only uppercase letters

Hi, Im trying to solve a problem using re module, and one of the requests is to find a string with the letters ATGC only in uppercase. this is my code: def isVCF(file): num_format = re.compile(r"^...
ranbarr Homework 6 3,295 May-27-2021, 05:01 PM
    Thread: Using regex for type validation
Post: RE: Using regex for type validation

(May-22-2021, 07:35 AM)Gribouillis Wrote: You would get a better structured code with a function to handle each line def is_vcf_line(line): columns = line.split('\t') return bool( re...
ranbarr Homework 5 2,681 May-22-2021, 09:39 AM
    Thread: Using regex for type validation
Post: RE: Using regex for type validation

(May-21-2021, 05:50 PM)Gribouillis Wrote: The 4th and 5fth column have indices 3 and 4, we are in Python. **blush** Thank you, totally my bad Now I do get true, but when I try to check a file that...
ranbarr Homework 5 2,681 May-21-2021, 08:16 PM
    Thread: Using regex for type validation
Post: Using regex for type validation

Hi everyone, I'm stating to learn regex and I'm trying to solve a problem using it. I need to write a function that gets a file and need to check some columns in the files and see if they stand the re...
ranbarr Homework 5 2,681 May-21-2021, 04:53 PM
    Thread: Checking if string starts the same but end differently using re module
Post: Checking if string starts the same but end differe...

Hi! Im learning the re module and having a difficulties with the writing of it so Ill be happy to have some explanations. I have a file with a lot of columns, and I try to find if its first column sta...
ranbarr Homework 1 1,683 May-20-2021, 02:21 PM
    Thread: Finding how many times substring is in a string using re module
Post: RE: Finding how many times substring is in a strin...

(May-19-2021, 03:29 PM)DPaul Wrote: if you import string and use count, it's a piece of cake. **smile** Little caveat if the 'i' in "i'm" does - or does not - count for i. Of course if you want ...
ranbarr Homework 4 2,958 May-20-2021, 02:07 PM
    Thread: Finding how many times substring is in a string using re module
Post: Finding how many times substring is in a string us...

Hi all, Im learning now the re module and I'm trying to use it to find how many times the words "i" and "i'm" in the song Party Rock Anthem. I changed the song to be in lowercase and wrote this: i_in_...
ranbarr Homework 4 2,958 May-19-2021, 12:34 PM
    Thread: Sorting list - Homework assigment
Post: Sorting list - Homework assigment

Hi everyone, Im doing an homework assigment and I keep getting False, I finally found the problem which is because the list isnt sort right but I have no clue how to fix that: the first part was to cr...
ranbarr Homework 1 2,238 May-16-2021, 02:51 PM
    Thread: Input validation for nested dict and sorting list of tuples
Post: Input validation for nested dict and sorting list ...

Hi everyone, First of all I want to say that I really appreciate this forum and Ive learned alot since I joined! Im trying to write a func that icludes input validation for a nested dict, converting i...
ranbarr Homework 3 3,910 May-13-2021, 03:14 PM
    Thread: combining dicts into one dict when not all keys are in both dicts
Post: RE: combining dicts into one dict when not all key...

(May-12-2021, 05:03 PM)BashBedlam Wrote: (May-12-2021, 03:33 PM)ranbarr Wrote: Why are they defined incorrectly?Because... (May-12-2021, 12:31 PM)ranbarr Wrote: dict1: {'AFG': 'Afghanistan', 'AL...
ranbarr Homework 5 2,649 May-12-2021, 05:29 PM
    Thread: combining dicts into one dict when not all keys are in both dicts
Post: RE: combining dicts into one dict when not all key...

(May-12-2021, 02:44 PM)BashBedlam Wrote: Your dictionaries are defined incorrectly but other than that, the code seems to be functioning as expected. dict1 = {'AFG': 'Afghanistan', 'ALB': 'Albania'...
ranbarr Homework 5 2,649 May-12-2021, 03:33 PM

User Panel Messages

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