Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,424 members, 7,819,528 topics. Date: Monday, 06 May 2024 at 05:36 PM

Python Programmers Hang-out - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python Programmers Hang-out (2503 Views)

I Need A Whatsapp Group For Beginner Python Programmers / Python Programmers Lets Meet Here!!! / Do Companies Employ Python Programmers In Nigeria? (2) (3) (4)

(1) (Reply) (Go Down)

Python Programmers Hang-out by gbolly1151(m): 8:25am On Jul 15, 2019
Hello fellow python programmers let hang-out,This thread is created to rub mind with python programmer,make friends with new python programmer,connect and discuss about python language in general

drop your challenge and let tackle it together.

#Togetherwegrow
Re: Python Programmers Hang-out by General0847: 8:35am On Jul 15, 2019
gbolly1151:
Hello fellow python programmers let hang-out,This thread is created to rub mind with python programmer,make friends with new python programmer,connect and discuss about python language in general

drop your challenge and let tackle it together.

#Togetherwegrow

You should drop your email address and twitter handle if you have one. From there we can network, share materials and other stuff related to python programming.
Re: Python Programmers Hang-out by gbolly1151(m): 8:41am On Jul 15, 2019
General0847:


You should drop your email address and twitter handle if you have one. From there we can network, share materials and other stuff related to python programming.

You can connect with me on Twitter @ajayigbolahan1
Re: Python Programmers Hang-out by General0847: 12:19pm On Jul 15, 2019
gbolly1151:

You can connect with me on Twitter @ajayigbolahan1
I will do that. Thanks
Re: Python Programmers Hang-out by Baabu320: 9:53am On Jul 16, 2019
Am a newbie and i want to learn python any help u guys can render will be appreciated
Re: Python Programmers Hang-out by honiboi(m): 11:27am On Jul 16, 2019
Don't we have hacking programmers?
Re: Python Programmers Hang-out by gbolly1151(m): 12:03pm On Jul 16, 2019
Baabu320:
Am a newbie and i want to learn python any help u guys can render will be appreciated

To learn python or any other programming languages, you can source for online resources but i recommended starting with tutorialpoint.com
Re: Python Programmers Hang-out by gbolly1151(m): 12:05pm On Jul 16, 2019
honiboi:
Don't we have hacking programmers?

Why not in as much it is white hacking
Re: Python Programmers Hang-out by johnbendie(m): 8:46am On Jul 21, 2019
gbolly1151:
Hello fellow python programmers let hang-out,This thread is created to rub mind with python programmer,make friends with new python programmer,connect and discuss about python language in general

drop your challenge and let tackle it together.

#Togetherwegrow

Nice, I know a bit of Python. I have done some rough homework with it on and off. What domain are you currently pursuing with Python?
Re: Python Programmers Hang-out by gbolly1151(m): 7:43pm On Jul 21, 2019
johnbendie:


Nice, I know a bit of Python. I have done some rough homework with it on and off. What domain are you currently pursuing with Python?

Web development with django
Re: Python Programmers Hang-out by iCode2: 12:39pm On Jul 23, 2019
gbolly1151:


Web development with django
What's the frequency of getting web development job with python/django? Most I see on here are php/laravel.
Re: Python Programmers Hang-out by gbolly1151(m): 2:33pm On Jul 23, 2019
iCode2:
What's the frequency of getting web development job with python/django? Most I see on here are php/laravel.
Well,your client dont care what language you use to development a website in as much it does the job require of it,simple to use,scalable and fast

2 Likes

Re: Python Programmers Hang-out by dansolution: 12:30am On Jul 27, 2019
Hello family,am new into programming and am currently running a class on python and data science.I will appreciate my ogas in the house,to share materials that would aid my learning. my email is danielachowue@gmail.com
Re: Python Programmers Hang-out by iCode2: 3:47pm On Jul 30, 2019
gbolly1151:

Well,your client dont care what language you use to development a website in as much it does the job require of it,simple to use,scalable and fast
They might care when they meet a laravel guy who's willing to do the work for a lesser price considering the fact that hosting is cheaper with laravel framework. Don't you think so?
Re: Python Programmers Hang-out by cochtrane(m): 1:11am On Jul 31, 2019
Python problem:

What ideas do you have for summing a nested list? e.g. sum([2, 9, [2, 1, 13, 2], 8, [2 , 6]]) = 45
Here's my approach with a list comprehension converting it to string and then to integers

sum([int(t.strip('[ [] ]')) for t in str(t).split(',')])

code won't work if you've got an empty list as a member, but of course this can be slightly adjusted to account for this
Re: Python Programmers Hang-out by cochtrane(m): 8:18pm On Jul 31, 2019
Problem:
Flatten a nested list.
for a list like
[2,[9,1,1],[2,1,[13,5,4,1],2],8,[2,6]]
, obtain
[2, 9, 1, 1, 2, 1, 13, 5, 4, 1, 2, 8, 2, 6]


Going OOP approach:

class NestedList:
"""Represents class of nested list and hosts methods
which work on this type of lists"""

def __init__(self, val=None):
if val is None:
self.val = []
else:
self.val = val

def flatten(self):
"""flattens a nested list into a list object"""

output = []
for element in self.val:
if isinstance(element, list):
e = NestedList(element)
output += e.flatten()
else:
output += [element]
return output

def __str__(self):
"""print nested list"""

return str(self.val)


output:

>>> j = NestedList([2,[9,1,1],[2,1,[13,5,4,1],2],8,[2,6]])
>>> print(j)
[2, [9, 1, 1], [2, 1, [13, 5, 4, 1], 2], 8, [2, 6]]
>>> j.flatten()
[2, 9, 1, 1, 2, 1, 13, 5, 4, 1, 2, 8, 2, 6]


Actually quite cute to employ recursion in solving the problem.
Re: Python Programmers Hang-out by cochtrane(m): 1:11am On Aug 01, 2019
Problem:
count the number of occurrence of a target in a nested list

For a list like:
[2,[9,1,1],[2,1,[13,5,4,1],2],8,[2,6]]

number of occurrence of number 2 = 4


Still OOP:

class NestedList:
.
.
.
.
def count(self, other):
"""counts the number of occurrence of target in
a nested list"""

icount = 0
for element in self.val:
if isinstance(element, list):
e = NestedList(element)
icount += e.count(other)
else:
if element == other:
icount += 1
return icount



Output:

>>> j = NestedList([2,[9,1,1],[2,1,[13,5,4,1],2],8,[2,6]])
>>> j.count(2)
4
Re: Python Programmers Hang-out by cochtrane(m): 4:19am On Aug 02, 2019
obtain transpose of a 4x3 matrix:
matrix is a tuple of tuple represented as
((0, 1, 2), (3, 4, 5), (6, 7, 8 ), (9, 10, 11))

This should yield a 3x4 matrix represented again as a tuple of tuple:
((0, 3, 6, 9), (1, 4, 7, 10), (2, 5, 8, 11))


At the command line:
(venv) C:\Users\...\...\Tests>python
Python 3.7.3
Type "help", "copyright", "credits" or "license" for more information.

>>> data = ((0, 1, 2), (3, 4, 5), (6, 7, 8 ), (9, 10, 11))
>>> data_transpose = tuple(zip(*data))
>>> data_transpose
((0, 3, 6, 9), (1, 4, 7, 10), (2, 5, 8, 11))
Re: Python Programmers Hang-out by cochtrane(m): 6:58am On Aug 03, 2019
Problem:
if you created a 100 x 100 matrix where each element is an average of 20 random numbers from 0 to 100, will there exist a pattern?
Most probably! Even random number generators are biased.

Put this to the test in python and we get a clear histogram biased towards the center as more and more datapoints are added.
Quite an interesting visualization.

# create mean function
def mean(num_list):
return sum(num_list) / len(num_list)

# create average list of 1 x list_length, with sample_fraction determining what fraction to obtain from list_length
def obtain_average(list_length, sample_fraction):
average_list = []
for i in range(list_length):
average_list.append(mean(random.sample(range(list_length), int(list_length/sample_fraction))))
return average_list

#create 100 x 100 matrix of averages (1/5) of list_length
with open('store_text.txt','w') as f:
for i in range(100):
f.writelines([str(x) + "\t" for x in obtain_average(100,5)])
f.write('\n')

#transpose data
with open('store_text.txt','r') as f:
data = f.readlines()

data = [tuple(item.split("\t" )) for item in data]
data_transpose = list(zip(*data))

with open('store_text.txt','w') as f:
for i in range(100):
f.writelines([str(x) + "\t" for x in data_transpose[i]])
f.write('\n')

#plot data

data shows that by the time we are getting to the 30th list, a clear pattern starts to form biased to the center

Re: Python Programmers Hang-out by swizzy2k: 2:00pm On Aug 06, 2019
Please,, it is needed for my final year project. I have already trained the SVM model. Please how will I send information from flask using sublime IDE to my database. I used mysql_connector to connect flask with database.
Re: Python Programmers Hang-out by Terz4christ: 8:22pm On Aug 06, 2019
Glad to be here
Re: Python Programmers Hang-out by ILoveLight: 3:43pm On Aug 07, 2019
dansolution:
Hello family,am new into programming and am currently running a class on python and data science.I will appreciate my ogas in the house,to share materials that would aid my learning. my email is danielachowue@gmail.com

Please where are you running the program cos I'm interested in it too
Re: Python Programmers Hang-out by benob(m): 4:54pm On Aug 07, 2019
To learn python programming for starters. What's the best laptop to buy
Specs and brand
Thanks

1 Like

Re: Python Programmers Hang-out by gbolly1151(m): 9:55pm On Nov 05, 2019
benob:
To learn python programming for starters. What's the best laptop to buy
Specs and brand
Thanks

Core i5
8gb ram
Re: Python Programmers Hang-out by gbolly1151(m): 1:18pm On Nov 29, 2019
It been a while here,let hook ourselves with a question here

On heroku, I understand that dyno is a virtual file system on which django app are served and can go off anytime, when this happen, do i need to set the config var again to start my app when dyno is on again?

(1) (Reply)

30 Days Of Code {April 19 - May 18} / Got A Remote EU Job But… / I Need Help With Android Studio!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 39
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.