Questions tagged as 'python-3.x'

2
answers

Calculate how many NaN in each Python time

Good morning, I have a DF where you have NaN and I need to count how many NaN I have in each time. My df has a period of 31 days. I think I should use Groupby, but I'm not finding a way. import numpy as np import pandas as pd df...
asked by 17.03.2017 / 15:34
2
answers

Function that determines if all the letters contained in a string are in the other

def isWordGuessed(secretWord, lettersGuessed): ''' secretWord: string, the word the user is guessing lettersGuessed: list, what letters have been guessed so far returns: boolean, True if all the letters of secretWord are in letter...
asked by 22.04.2018 / 20:15
3
answers

PYTHON- Program that prints on the screen all numbers divisible by 7 but not multiples of 5, between 3000 and 3200 (inclusive)

Hello, I am doing the following program: The program should print all numbers divisible by 7, but not multiples of 5, between 3000 and 3200 (inclusive). It turns out that I already did the code, but this one is not working in the best way...
asked by 27.04.2018 / 10:34
2
answers

Create the .txt file in PYTHON if it does not exist

The code: arquivo = open(input('Nome do arquivo a ser editado:'), 'r') texto = arquivo.readlines() texto.append(input('Insira o texto:')) arquivo = open(input('Nome do arquivo a ser editado:'), 'w') arqu...
asked by 06.06.2016 / 03:09
2
answers

How to remove specific position characters from a string?

I have a string read from a file that contains a data and the newline special character '\ n'. Example: dado = 'teste \n' First check the string size, so I can remove the last two characters, but how can I remove pointing to the character's...
asked by 29.01.2018 / 13:20
1
answer

Problem with swapcaser in python

The program should convert a letter into schema A-> a or a-> A and work normally except that at the end of the string a None appears. Anyone know how I can strip it? def swap_case(s): for x in s: if x.isupper()==True: print(x.lower...
asked by 29.01.2018 / 12:49
4
answers

Back position in JSON format data or list with Python

I'm working with data similar to the structure below: {"Id":1, "Data_inscricao":"2017-01-01", "Texto":"Loremipsum", "Numeracao":26, "Tempo":"25s"}, {"Id":3, "Data_inscricao":"2010-05-02", "Texto":"LoremipsumLorem", "Numeracao":656, "Tempo":9}...
asked by 07.06.2017 / 03:18
1
answer

Latex and Python integration

I need to generate and save a PDF file with some data I dealt with in a script I made to generate a report, but I do not know how to do it. Does this data need to go through a .tex file before generating the PDF? If yes, how can I work with v...
asked by 27.06.2017 / 22:04
3
answers

How to put punctuation with the last word on the left?

It may seem like a silly question, but I did not really find an answer in my readings. I created a program whose purpose is to calculate my Coefficient of Income and the percentage of the course completed in college, whose code follows below:...
asked by 04.01.2019 / 23:43
1
answer

How to add elements of a list in a dictionary in Python3

Good afternoon, I'm having trouble adding elements from a list into a dictionary. The elements of the list to put in the dictionary are: ['Joao', '83889023', 'Maria', '81944356', 'Marcos', '32258899', 'Ana', '88235423', 'George', '1254345...
asked by 14.06.2018 / 20:36