Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Question in the twilight zone! What would you use if there was no python?
Post: Question in the twilight zone! What would you use ...

What language would you use if python did not exist?
rxndy Bar 15 5,700 May-14-2019, 07:03 PM
    Thread: What are some pythonic phrases?
Post: RE: What are some pythonic phrases?

Too many nested code blocks increases code smell.
rxndy News and Discussions 7 3,165 May-14-2019, 06:44 PM
    Thread: Converting Program to OOP
Post: RE: Converting Program to OOP

A User class could be made for this and a Rolodex Class as a controller for a list of User objects/dictionaries. I did it that way, but yea like ichabod said, I don't think your script is complicated...
rxndy General Coding Help 2 3,950 May-13-2019, 07:28 PM
    Thread: Error while fetching data from PostgreSQL
Post: RE: Error while fetching data from PostgreSQL

I hope this doesn't sound negative in any way, just trying to give you a resource: I recommend learning Postgres at pgexercises.com
rxndy General Coding Help 3 4,310 May-13-2019, 02:38 PM
    Thread: Get syntax error. Dont understand why
Post: RE: Get syntax error. Dont understand why

Does anyone have any docs on the first line? specifically the init python: # and label start:
rxndy General Coding Help 21 14,650 May-13-2019, 02:34 PM
    Thread: Automated Git add/commit/push
Post: Automated Git add/commit/push

Hey! I have a personal ERP I wrote for my small business in python/flask and I was wondering if it would be wise, (security-wise) to automatically push changes that my sqlite.db file have in my pytho...
rxndy Web Scraping & Web Development 0 2,024 May-13-2019, 11:51 AM
    Thread: Numpy question
Post: RE: Numpy question

yep! np.where just returns a data structure with the locations of what you want. so I would do something like so: a[np.where(a>0)]
rxndy General Coding Help 3 2,666 May-12-2019, 11:45 PM
    Thread: New Python Facebook Group for people that live in Miami!
Post: New Python Facebook Group for people that live in ...

Hi, I just started a Python Facebook Group for people that live in Miami! Our first meetup is in August, we will be collaborating to use the bleeding edge of Functional/Object Oriented/Asynchronous p...
rxndy News and Discussions 1 1,834 May-12-2019, 10:24 PM
    Thread: how can I write my function output on CSV file
Post: RE: how can I write my function output on CSV file

(May-02-2019, 04:52 PM)buran Wrote: @rxndy, this is most probably just a school project/homework assignment and I doubt they will be allowed to to use pandas and please fix your code because you wil...
rxndy General Coding Help 13 5,502 May-02-2019, 04:58 PM
    Thread: how can I write my function output on CSV file
Post: RE: how can I write my function output on CSV file

A way that is much faster is: import pandas as pd df = pd.read_csv("grades.csv") grades = df.iloc[:, 1:] names = df.iloc[:, 0] averages = grades.mean(axis=1) output = pd.DataFrame(names, averages) o...
rxndy General Coding Help 13 5,502 May-02-2019, 04:48 PM
    Thread: TO ELSE OR NOT TO ELSE?
Post: RE: TO ELSE OR NOT TO ELSE?

Wow, I totally agree with you! I will take those golden nuggets on my next app. mainly the part about asking for forgiveness instead of checking for permission.
rxndy General Coding Help 4 2,753 Apr-30-2019, 11:42 PM
    Thread: TO ELSE OR NOT TO ELSE?
Post: RE: TO ELSE OR NOT TO ELSE?

Yep, that function name is very poor :/ that is a good catch. I really meant to give it another name like def make_decision(number), because what I was wondering was that really good programmers in ...
rxndy General Coding Help 4 2,753 Apr-30-2019, 02:11 AM
    Thread: PHP to Python
Post: RE: PHP to Python

That is the basic principle of pythonic code: use built in libraries and use Object oriented / functional code that reduces the number of lines of code.
rxndy General Coding Help 11 4,848 Apr-28-2019, 01:21 AM
    Thread: Python for Enterprise Data Science
Post: RE: Python for Enterprise Data Science

I am a little confused about these questions. Do you mean packaging a python app/api/script? or Do you mean packaging the python implementation?
rxndy Data Science 3 2,794 Apr-27-2019, 08:56 AM
    Thread: Numpy question
Post: RE: Numpy question

Sup dude or dudette! I recommend the np.where() function where import numpy as np is the library used and definition of np so in this example, we need to work our way up to really learn this api. h...
rxndy General Coding Help 3 2,666 Apr-27-2019, 08:37 AM
    Thread: lowercasing to strings before comparison
Post: RE: lowercasing to strings before comparison

I like to use list comprehensions when going over an iterable: usernames = ["Tom", "Brady"] lowered_usernames = [name.lower() for name in usernames]
rxndy General Coding Help 4 2,725 Apr-27-2019, 02:33 AM
    Thread: functions in a dictionary
Post: RE: functions in a dictionary

I like doing: super_func = { 'add': sum, 'foo': lambda a:a*a+a }I wouldn't delete it like this... because you want to use it in the future del super_func["foo"]So what I would do is maybe create ...
rxndy General Coding Help 7 3,434 Apr-27-2019, 02:25 AM
    Thread: functool - partial errors
Post: RE: functool - partial errors

I recommend using argument names: for example func1(arg1="tomato", arg2=partial(blehbleh)) This may help because you may be passing partial to the wrong argument/parameter.
rxndy General Coding Help 1 2,019 Apr-27-2019, 02:12 AM
    Thread: TO ELSE OR NOT TO ELSE?
Post: TO ELSE OR NOT TO ELSE?

Should we always use else statements? By using else statements you are kind of doing the same thing that the programming gods Ken Thompson and Rob Pike recommend in GOLANG, which is to make sure you ...
rxndy General Coding Help 4 2,753 Apr-27-2019, 02:04 AM
    Thread: Just completed Learning Python the Hard Way
Post: RE: Just completed Learning Python the Hard Way

(Apr-26-2019, 07:54 PM)micseydel Wrote: (Apr-26-2019, 02:38 PM)rxndy Wrote: I was wondering if you had any specifics as to what are the specific things Shaw teaches that are wrong? A lot of people...
rxndy General Coding Help 5 3,535 Apr-27-2019, 01:48 AM

User Panel Messages

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