Skip to main content
Image

r/learnpython


Which Python library is best to learn from scratch+for ERP /industrial environment
Which Python library is best to learn from scratch+for ERP /industrial environment

Hi,
So I currently work mainly in SAP, excel, Power BI.
Now I would like also to try use Python in our company to lets say automate certain tasks (download data from SAP and automatically transform and trim them for example).
I am starting as Data Analyst of sorts and need some recommendation (maybe for some library) what would be the best.
Most data I will download will be production related, production orders, sales, demands etc.
I am open to any ideas.

Thank you


Every side has a story. The All-New Mazda CX-5. More to move every side of you. Learn more.​
media poster


I spent months learning Python and only today realized I've been confused about something embarrassingly basic
I spent months learning Python and only today realized I've been confused about something embarrassingly basic

I've been writing Python scripts for a while now. Nothing crazy, just automating small stuff, scraping some data, making my life a little easier. I thought I had a decent handle on things.

I was looking at someone else's code and they used a list comprehension in a way that made me stop and read it three times. I realized I had been writing loops the long way this whole time not because I didn't know list comprehensions existed but because I never really trusted myself to read them when I wrote them fast. I kept defaulting to the for loop because at least I could trace it line by line without second-guessing myself.

I don't know if this is a common thing but I feel like there's a version of learning where you know a concept exists, you've seen it work, you've even used it a few times, but you haven't actually internalized it. You're kind of faking fluency in that little area. I was doing that with list comprehensions, with zip, with a few other things I won't list here because it's already embarrassing enough.

Once I wrote out ten examples by hand tonight it clicked in a way it hadn't before even though I'd "learned" this two years ago.

Anyone else have a concept they thought they understood for a long time before actually understanding it?


how to load csv faster in Python.
how to load csv faster in Python.

Hello python folks, R user here, trying to use python for a project for which i've been specifically asked to. So I am new to python

The problem is : I have a 100 mo csv of about 300000 lines that takes ages to get read using all of these :

# first try 
df=pd.read_csv('mycsv.csv')

#second 

# Utiliser read_csv avec dtypes pour accélérer la lecture
dtypes = {
    "Model": "category",
    "Scenario": "category",
    "Region": "category",
    "Variable": "category",
    "Unit": "category",
}


# Les colonnes années seront lues comme float
annees = [str(y) for y in range(1950, 2101, 5)]
for year in annees:
    dtypes[year] = "float32"


# Lecture du CSV
df = pd.read_csv(
    "mycsv.csv",
    dtype=dtypes
)


print(df.shape)
print(df.head())

#3rd try 
import polars as pl


# Lecture complète très rapide
df = pl.read_csv("/Users/Nawal/my_project/data/1721734326790-ssp_basic_drivers_release_3.1_full.csv")


print(df.shape)
print(df.head())

it littrally took me 2 s to do this under R. Please help. what am I missing with python ???

thank you all