Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 14 2020 22:38
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:37
    @bjorno43 banned @real-action
  • Feb 01 2020 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:07
    @bjorno43 banned @doctor-sam
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 2019 19:46
    @mstellaluna banned @zhonghuacx
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 22:04
    @mstellaluna banned @dertiuss323
  • Jan 07 2019 15:43
    User @mstellaluna unbanned @oudarjya718
  • Jan 06 2019 15:14
    @mstellaluna banned @oudarjya718
  • Dec 15 2018 23:38
    @mstellaluna banned @Julianna7x_gitlab
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 22:59
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:13
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 27 2018 19:07
    User @mstellaluna unbanned @JomoPipi
  • Aug 27 2018 06:17
    @mstellaluna banned @JomoPipi
kaddkaka
@kaddkaka
In [3]: a = np.array([7, 5, 4])
In [5]: np.vectorize(np.binary_repr)(a)
Out[5]:
array(['111', '101', '100'],
      dtype='|S3')

In [6]: np.vectorize(bin)(a)
Out[6]:
array(['0b111', '0b101', '0b100'],
      dtype='|S5')
Joshua Jamison
@codemation
Nothing advanced, but for those interested in data / cicd pipelines
https://medium.com/analytics-vidhya/creating-a-data-pipeline-with-easyjobs-fastapi-4e302556f05d
Yosi
@yosiasz
:point_up: very nice! @codemation
Shirish Bajpai
@ryuzakace
Hey Guys, I was trying to implement HDP using Gensim's HDP. https://stackoverflow.com/q/66761515/8215148
Buğra
@BgR8
Ekran Alıntısı.PNG
hi, how to solve this problem,
should i add a Foreign Key for Operation to Bin Table
RashiqAzhan
@RashiqAzhan
@BgR8 You could do that but you would be repeating the latitude and the longitude fields.
It would best to create a new table with the columns Bin.id, Bin.collection_frequency, Bin.last_collection, Operation.idwith Bin.id and Operation.id being the composite key for that table.
Drop the Bin.collection_frequency, Bin.last_collection fields from the Bin table afterwards as it is redundant and not useful anymore.
Buğra
@BgR8
thanks @RashiqAzhan
RashiqAzhan
@RashiqAzhan
@BgR8 Welcome.
vjanz
@vjanz
Hey Guys,
Aside from loogging module from python, do you know any good library or configuration for logging?
Joshua Jamison
@codemation
@vjanz what do you want to do, that the standard library logging module cannot?
Cassiel-girl
@Cassiel-girl
The python doesn't support the static member of class, right?
like c/c++ static keyword in class
Alpha-Craft
@Alpha-Craft_gitlab
Yes. Seems you're right.
RashiqAzhan
@RashiqAzhan
@Cassiel-girl Hi! I'm not sure what you're trying to achieve but if by "static members" you mean being able to call attributes and methods without instantiating a class then python does support them, well Python 3 anyways.
JohnO
@jouellnyc
Aside from loogging module from python, do you know any good library or configuration for logging?
Also not sure what your objective is but have you seen structlog?
https://www.structlog.org/en/stable/getting-started.html#structlog-and-standard-library-s-logging ?
Cassiel-girl
@Cassiel-girl
Was the purpose of the introduction of generators to simplify the iterator creation process? That is, the use of generators simplifies the process of constructing an iterator by customizing a class.
12annumishra17
@12annumishra17
Hi Team,
Had a query
How can we save the value of each iteration in a new variable depending upon the length of list
kaddkaka
@kaddkaka
@12annumishra17 you have to explain more clearly, how does the length of the list affect the outcome except that you iterate over the list?
12annumishra17
@12annumishra17
I am using currently if else but is there any way to optimise this code

L =[]
a = 'harsh mishra mishra nnn'
x = a.split()
for y in x:
L. append(y)

if len(L) == 2:
a = L[0]
b = L[1]

print(a,b)

elif len(L) == 3:
a = L[0]
b = L[1]
c = L[2]
print(a,b,c)
elif len(L) == 1:
a =L[0]
b =L[0]
print(a,b)

kaddkaka
@kaddkaka
It seems like your default case is to print the list, with the quirk that you should duplicate the first item if there is only 1 item in the list.
Does this code work?
L = list("harsh mishra mishra nnn".split())
if len(L) == 1:
    L.append(L[0])
print(L)
12annumishra17
@12annumishra17
Default case is like suppose I have a string which might consist of 1,2,3,4 ... n no. Of words. So I am trying to split each word and want to store each word in a new variable
kaddkaka
@kaddkaka
Why do you want them in separate variables if you already have them in a list?
12annumishra17
@12annumishra17
So it should dymically define the number of variable depending upon the no. Of words in string
kaddkaka
@kaddkaka
What would you use that for? I think it would be really hard to use that conveniently. There is no automagic way to come up with new variable names
12annumishra17
@12annumishra17
Okay taking the case when the item is there in the list so in this case suppose I pass 0th index element to a function and 1th index to another function statically so in that case if my string consist of only 1 word then the code would show error while accessing the 1st index element because the list has item only at 0th ondex
kaddkaka
@kaddkaka
So the best way would be have them numbered right? Otherwise you would run out of letters. L0, L1, ...Ln would perhaps make sense. But what is the difference from keeping them in a list L that already can store any number of items? And you get easy access to all of the values L[0], L[1], ..., L[n]?
You can send the value of any item in the list to a function.
def a_function(arg):
    print(arg)

L = [1, 2, 3]
a_function(L[0])
there is no need to give it a seprate name first
Joël Larose
@joel.larose_gitlab
@12annumishra17 Arrays, lists, indexed containers in general, were all invented precisely to solve the problem of needing a changing number of variables. Maybe indexing by numbers doesn't work for you, in which case you might want to look at dict, which allows you to give string names to your indices.
Vlad Emelianov
@vemel
hello guys! I have created a CLI app to clone, update and share GItHub Actions across projects. Written in TypeScript and comes with a ready-to-use pack of workflows for Python projects (pipenv, poetry, requirements.txt is supported). Please let me know if you find it useful https://github.com/vemel/github_actions_js
Cassiel-girl
@Cassiel-girl
lib/python3.9/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5DBus.so.5: symbol dbus_message_set_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libdbus-1.so.3 with link time reference
how to solve this question in unbuntu?
TaeWoo Kim
@taewookim
Is it possible to install different python version (particularly 3.7.5) with apt-get?
Vlad Emelianov
@vemel
you can connect 3rd party sources for this, but it is easier to use https://github.com/pyenv/pyenv
alisson-roger
@alisson-roger
There is space for begginers in python, here?
Vlad Emelianov
@vemel
better use discord, i guess
Cassiel-girl
@Cassiel-girl
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/time/install_file/Python-3.9.4/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmpz4ohuh/setuptools-49.2.1-py3-none-any.whl\', \'/tmp/tmpz4ohuh/pip-20.2.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmpz4ohuh\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="main__", alter_sys=True)\n']' returned non-zero exit status 1.
when I install python3.9 on centos7, how to solve this?
Cassiel-girl
@Cassiel-girl
image.png
how to fix this conflict?
3 replies
Brijesh Soni
@ibrijeshsoni

Hello @All

I am woking on the PDF Reading , but not able to get the perfect Package to be used, I have priorly use the pdfplumber for extracting Tables .. now this task I have to exctract teh numberic bullet points' e.g.

2. Data
2.1 New Data
2.1.1 Child data
     conclusion: askjkajsjslajskjak
Hi
@vonstark
hi. Im new to python. am using joblib and requests. Everytime I try to parallel job more than 2 with request, it seems dead. the _threadlock occur, and I guess its "requests" locked it? any idea using alternative http client or?
Hi
@vonstark
hmm.. guess move to asyncio is faster
kaddkaka
@kaddkaka
Hi, where is a good place to informally discuss a python PEP idea?