Questions tagged [python-3.6]

Version of the Python programming language released in December 2016. For issues specific to Python 3.6. Use more generic [python] and [python-3.x] tags where possible.

Python 3.6 is the currently newest version of the popular Python programming language (see PEP 0494).

Use this tag if your question is specifically related to Python 3.6. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

5657 questions
1
vote
0 answers

json dump multiple dictionaries

I have these 3 dictionaries based on a large data set I have made. I need to have them saved to a json file but I don't know where to start. result1 = {codes[i]: ucr_ncic_code[i] for i in range(len(ucr_ncic_code))} result2 = {districts[i]:…
RMaxwell87
  • 119
  • 8
1
vote
1 answer

Python behavior in replacing dictionary keys under iteration

I'm looking at a piece of Python 3.6 (note that Python 3.8 throws an error instead) code below: x = {0: None} for i in x: del x[i] x[i+1] = None print(i) This is deleting key i and adding key i + 1 to the dictionary at every iteration,…
MLavrentyev
  • 1,827
  • 2
  • 24
  • 32
1
vote
2 answers

Problem importing sip after successful installation

Using python 3.6 in a virtual environment created by python3 -m venv env_name I need to use the python sip module. I activate the venv by source env_name/bin/activate I install this successfully by pip install sip which results in Installing…
Morten Nissov
  • 392
  • 3
  • 13
1
vote
2 answers

Python telegram bot doesn't recognize text message

Here I have a code for making a simple echo bot for telegram. from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import logging from data.constants import API_TOKEN, LOGGING_FORMAT logging.basicConfig(format=LOGGING_FORMAT,…
1
vote
3 answers

matching whitespace seems to be non-greedy

I'm writing a small helper script to analyse C code, especially the use of structs. I have problems detecting when a struct is used as a value as opposed to a pointer. That means I want to detect if the text struct foo is followed by an arbitrary…
arne
  • 4,514
  • 1
  • 28
  • 47
1
vote
1 answer

How to decode LabelEncoder encoded column in pandas DataFrame?

I'm having a dataset. Where I was practicing feature engineering by converting categorical objects to numbers, with the following lines of code: import pandas as pd import numpy as np from sklearn import preprocessing df =…
1
vote
0 answers

How to properly call a coroutine from a coroutine in a subclass

I am new to Python's async, so bear with me please... So, I am trying to extend the functionality of a class, let's say it's defined as such: class OrigClass: ... async def another_method(self, *args): # Some code irrelevant to…
pepoluan
  • 6,132
  • 4
  • 46
  • 76
1
vote
2 answers

How to convert Tensorflow Object Detection API model to TFLite?

I am trying to convert a Tensorflow Object Detection model(ssd-mobilenet-v2-fpnlite, from TensorFlow 2 Detection Model Zoo) to TFLite. First of all, I train the model using the model_main_tf2.py and then I use the export_tflite_graph_tf2.py to…
1
vote
1 answer

How to parse value from same tag using ElementTree in Python?

I'm using python to parse a XML file but I have a problem. I'm getting the values in form of a dictionary but if there are two or more same values then they are not repeating. I'm sure there is a way to solve it but I'm new on python and parsing…
ArenMayank
  • 17
  • 4
1
vote
1 answer

SSL Related Errors Testing Fresh Python 3.6.6 Installation

I followed your tutorial on RealPython for installing Python 3.6.6 on Debian 10 Buster. It fails the tests when I run make -j 8 or python3.6 -m test after a make altinstall.  During the test_ftplib.py the tests hang, and after a Ctrl-C a couple of…
user1045680
  • 815
  • 2
  • 9
  • 19
1
vote
2 answers

I defined my funtion but it wont run. why not?

My function that asks the user to input a 7 character number. but when i define it, it wont run. reason why? any help is appreciated. def eticketNum(): while True: eTickNum = input('please enter eticket number:') if len(eTickNum)…
ofori
  • 21
  • 2
1
vote
2 answers

How to set discord.py bot status to listening/watching/etc

BTW I'm using rewrite version Here is the code for original version, which seems not to work on rewrite await bot.change_prescence(activity=discord.Game('sample text', type=2)) How do I make the bot status listening?
Delta888
  • 84
  • 6
1
vote
1 answer

How to Merge Python List containing dictionaries into one final list

Here are my Lists: prices = [ {'price': '19,294'}, {'price': '20,365'}, {'price': '21,437'}, {'price': '22,628'}, {'price': '25,963'}, {'price': '26,439'}, {'price': '28,821'}, {'price': '29,417'}, {'price': '26,320'}, {'price':…
1
vote
1 answer

Spacy.io Entity Linker "not enough values to unpack (expected 2, got 0)"

I have being trying to use Spacy.io's Wikipedia Entity Linker posted here. When running "wikidata_train_entity_linker.py" I got the following error at the 3rd epoch. I need help understanding why I am getting the error below. I googled and the only…
eboraks
  • 25
  • 4
1
vote
1 answer

Why isn't my thread starting back up when the Condition object is notified/released?

This question pertains to Python 3.6. I have a piece of code which has a thread from the threading library running, as well as the program's main thread. Both threads access an object that is not threadsafe, so I have them locking on a Condition…
1 2 3
99
100