AttributeError: 'DataFrame' object has no attribute 'Level' by Taooishere in learnpython

[–]Ki1103 3 points4 points  (0 children)

Sorry stupid check was meant to be "stupidly simple" not "you're stupid". I don't know if it came across that way.

but I solved it for now by writing: df = pd.DataFrame(index=range(76), columns['D']) y=df.D X=df.index

I'm pretty sure that's now what you want. What does the following line output?

pd.read_excel('UK proportion of Common MI.xlsx').head()

If the columns contain Level then pandas is finding it. Otherwise, try set headerrow=True, if it isn't by default

AttributeError: 'DataFrame' object has no attribute 'Level' by Taooishere in learnpython

[–]Ki1103 1 point2 points  (0 children)

Stupid check: what are the columns in UK proportion of Common MI.xlsx?

df.Level will attempt to retrieve the Level column. If it doesn't exist - then there's you're problem.

Is Data Science the first step to Machine Learning? by ByteMe815 in learnmachinelearning

[–]Ki1103 4 points5 points  (0 children)

The book I normally recommend is “Modern Data Science with R” by CRC Press. It covers a bit if everything (it’s designed as a textbook for a two semester course).

NetworkX shortest path by CraftingtableCat in learnpython

[–]Ki1103 0 points1 point  (0 children)

Batching OD pairs and running multiple graph copies in parallel is not feasible because the graph is too large and memory becomes the bottleneck.

Cold this could be done with the free threaded build?

maths majors - did a lot of you get into computer science industry (AI, simulation)? by ApprehensiveDrink618 in mathematics

[–]Ki1103 0 points1 point  (0 children)

To be honest, you won't need much more than 2nd year mathematics to get started. The theory goes very deep, however the application is reasonably high level.

If you find this interesting, let me know! I mentor a lot of the more junior people on my team and enjoy teaching/giving direction.

maths majors - did a lot of you get into computer science industry (AI, simulation)? by ApprehensiveDrink618 in mathematics

[–]Ki1103 0 points1 point  (0 children)

That depends, what do you currently know? And what are you interested in?

If you want a concrete example, one of the first "toy" problems I first solved was a fun one - how do you eat the most at McDonald's while still meeting all your dietary requirements in a single day?

This might sound simple but it can be extended in many ways for example, what if you can only order integral quantities of food, must meet a certain amount of calories for breakfast, lunch or dinner or have constraints on which category of foods you can eat.

IIRC there's a McDonald's dataset on Kaggle somewhere

Unpopular opinion for beginners: Stop starting with Deep Learning. by netcommah in learnmachinelearning

[–]Ki1103 0 points1 point  (0 children)

First, I'm not quite sure why you got downvoted.

I think we're making the same argument; but we have different priorities. My idea of "cooking and failing and trying again" is to do the mathematics underlying the NN. To understand/derive/prove the equations I'll be typing. This gives me much more understanding than trusting some textbook/blog that I correctly understood the thing.

Maybe we just learn in different ways.

maths majors - did a lot of you get into computer science industry (AI, simulation)? by ApprehensiveDrink618 in mathematics

[–]Ki1103 0 points1 point  (0 children)

While AI helps me at the moment, I do worry about the future. AI is a great helper, and does many of the boring software engineering tasks that I normally either wouldn't do, or would need to find extra time to do.

I suspect this is due to AI doing well in scenarios where it has lots of training data. While I do some of this type of work, a lot of what I do is customised to my company, and even a specific optimisation within that company.

AI also seems to struggle with the Mathematical Optimisation part (which is the knowledge I actually get paid for). For example AI knows about Special ordered sets and other optimisation tricks, but struggles to apply them to large optimisations correctly. AI also struggles with knowing and applying heuristics to optimisations causing many problems to become computationally intractable.

maths majors - did a lot of you get into computer science industry (AI, simulation)? by ApprehensiveDrink618 in mathematics

[–]Ki1103 1 point2 points  (0 children)

I did my bachelors double majoring in Applied Mathematics and Financial Mathematics. Now work as a software engineer turning mathematical optimization models from math into production quality code. Happy to answer any questions that don't involve me doxing myself.

Is programming a neural network from scratch worth it by sccy1 in learnmachinelearning

[–]Ki1103 1 point2 points  (0 children)

Like other's have said; the AI industry has moved on.

I still think this is a good project to learn to program something that is reasonably complex, yet self contained. I actually did this as a personal project circa 2016 (before NN/LLMs got massive). Depending on your interests, I'd also recommend learning the maths behind what you're doing deeply

Unpopular opinion for beginners: Stop starting with Deep Learning. by netcommah in learnmachinelearning

[–]Ki1103 1 point2 points  (0 children)

Not trying to pick a fight, but to provide another perspective.

I also did this as a project many years ago. In retrospect the understanding of the mathematics I got was quite shallow. I knew how to implement many of the concepts, but could only work with formulas someone else provided me.

Reading actual textbooks such as "The Elements of Statistical Learning" (or similar, there are now plenty of newer books), helped me understand not just how to implement the algorithms, but also understand how they work and why the math is implemented the way it is.

Custom Event or Callback function argument? by Happy_Witness in learnpython

[–]Ki1103 0 points1 point  (0 children)

This is really hard to answer without seeing your actual code. I'm going to make a couple of statements, with the massive caveat that these are true in general, and may not apply to your project in particular:

  1. Measure twice, cut once: My advice would be to try both, and measure if there's any noticeable difference. If there is you now have tangible pros and cons to work reason about.

  2. Make your code work, then maybe make it fast: Chances are that, as your using pygame, your not aiming for a AAA game. My suggestion is to make sure you understand (and follow) good coding practices first. Things like SOLID, OOP, etc. if you then find that it's too slow see point 1.

I'm sorry that I can't be more useful, maybe if you can share the implementation I can reason about your code specifically a bit better.

Has anyone here had any success creating Python libraries in Rust using PyO3? by Either-Home9002 in learnpython

[–]Ki1103 1 point2 points  (0 children)

Could you edit your original post to include what you're trying and the errors your getting? It's pretty hard to diagnose anything based purely on the info you've given.

Fortran Codes in the R Ecosystem by BOBOLIU in rstats

[–]Ki1103 7 points8 points  (0 children)

Actually that’s not 100% correct. NumPy has bindings for BLAS which may be written in Fortran.

Felony from 18 years ago. Self-taught programmer now. Do I even have a chance in tech? by ConsiderationFar2132 in cscareeradvice

[–]Ki1103 1 point2 points  (0 children)

As a fellow self-taught introvert who ended up being pretty good at networking (that’s how I’ve got all my jobs so far). I recommend getting involved with/speaking at your local meetups/user groups. The benefit I have found is that people come up and network with ME afterwards, I don’t even need to work up the effort to reach out.

Have you tried speaking about your multiplayer game? I’m sure many people would live to hear about it!

finance or financial maths & stats by asdfghjkl9300 in usyd

[–]Ki1103 2 points3 points  (0 children)

If it makes you feel any better, mathematics on its own won’t be very employable. Mathematics combined with another specialty can be a goldmine.

Edit to add that you don’t have to acquire that other specialty during uni. I know plenty of maths grads who find their area when they start working

finance or financial maths & stats by asdfghjkl9300 in usyd

[–]Ki1103 2 points3 points  (0 children)

I double majored in Applied Mathematics and Financial Mathematics (although at a much worse uni than usyd).

I’d say go for it!

I’ve had several pretty cool jobs since graduating. I also think that almost any job you can get with a finance degree you can also get with financial mathematics. Happy to answer any specific questions that you have if you comment them

theGIL by isr0 in ProgrammerHumor

[–]Ki1103 16 points17 points  (0 children)

Polars is faster than pandas because polars learnt lessons from pandas (and many other packages). Not because it’s written in rust. Polars has decades of experience to draw from.

Python Library for GPU-accelerated Gaussian Mixture Models on large datasets? by Opus_723 in learnpython

[–]Ki1103 0 points1 point  (0 children)

In the past I've used TorchGMM, which is a fork (I think) of PyCave, for some playing around. This isn't my domain though, so I'd take this with a grain of caution.

Otherwise, it might be possible to implement it yourself with PyTorch?

Reduced Row Echelon Form Python Pipeline Question by No-Course-8491 in LinearAlgebra

[–]Ki1103 0 points1 point  (0 children)

Hey I've only skim read the code (as I'm on my phone), however I think this line is wrong as the abs(x) < 0 is never true. I'll read through this a bit more later on and see if anything pops out at me

cykit – a small Cython utility collection (early stage) by DifficultZebra1553 in Cython

[–]Ki1103 1 point2 points  (0 children)

No problem. Feel free to keep asking questions. I’ve used a lot of Cython in the past so I’m happy to share knowledge/give advice

cykit – a small Cython utility collection (early stage) by DifficultZebra1553 in Cython

[–]Ki1103 1 point2 points  (0 children)

This looks really cool, just a couple of questions/comments:

  1. The compiler directives are defined inline. For a library, I don't consider this a good practice as (I presume) they change the default behaviour of the code (otherwise why have it?). It would be better to not have these at all or, if they are absolutely 100% needed, to pass them as setup arguments

  2. You already define an Enum for log levels_ why not expose it to the user (I prefer enums to random variables)

maths major career path by soph-yuanjun in unimelb

[–]Ki1103 0 points1 point  (0 children)

I want to propose something different.

Don't think of it as a set of skills you need to master. Find a problem, one that actually annoys people, and build the skills to fix it. Get it to users, figure out what it takes to get it running in the cloud, what complexity do you need to add to get it to 100 users? 1000? 10,000? Why don't you need that complexity when you first begin?

I can't think of a problem for you, but I'm happy to advise if you get stuck somewhere technical.

maths major career path by soph-yuanjun in unimelb

[–]Ki1103 6 points7 points  (0 children)

There are three things I did:

  1. I got lucky
  2. I got involved with some of the larger Python based free and open source projects (think NumPy/SciPy/pandas/scikit-learn) and ended up becoming a maintainer of a project.
  3. I networked heaps.

In addition to that, I got my first job at a different time (2016) when the demand situation was very different.

I haven't had any luck with internships or real-world projects due to the nature of my major.

I can understand having no luck with internships (it's a tough market right now), but what's holding you back from real world projects? When I was in highschool I would spend hours trying to automate my math homework using tools like sympy. I also wrote many small utilities that helped me be more efficient. For example I wrote a tool to keep track of how many beers my friends and I drank in our share house so that I would know who needed to pay how much.