Skip Navigation
definitely accurate
  • Not the boss, just like in real life.

  • Holy voting choices!
  • This was the first time in Batman history that The Joker got to be Gotham major?

    It's so genius, that made me believe it's already happened before.

  • [image] Happy Friday!
  • I miss the critical mass so much. Used to go twice a month on Buenos Aires years ago, but moved countries and had to stop. Living in São Paulo the critical mass here is a shame. Stopped going after the second month in a row where nobody but me showed up.

  • US Crime Rate Drops to ‘Historic’ Lows With Murders, Rapes, and Robbery Plunging, New Statistics Show
  • The freakonomic guys are hacks that have no idea on how to do sociology or econometric analysis.

  • best way to access databases in different projects
  • Are you asking how to write a module that you can import?

    Yes, kinda.

    Are these the same set of DB files every time? Are the columns and other configurations the same? Are you writing new python code every month?

    They get updated by the accounting team each month. Some of them are csv, other come from an access database file, other from the sql server.

    Some of the code need to be run each month with the updated databases, but there's a lot of ad hoc statistical studies that my boss ask for that use the same databases.

    Are you using some ETL process to spit out a bunch of files that you'd like to have imported and available easily? Are the formats the same but the filenames differ?

    I guess yes. And not, the accountants keep the same filenames but change the directory lmao.

    I think it's the first thing you're after. There are a bunch of tutorials knocking around about this, eg,

    Thanks, im checking it out.

    how do I make it available for all my new python projects to use?

    import sys sys.path.append('my\\modules\\directory) import my_module

    I get the impression you're a data person rather than a programmer -perhaps you have a colleague who's more of the latter you can tap up for this?

    You're right, I'm an actuarie. I wanted to do computer science instead of actuarial sciences, but I tough that it would be better getting an actuarial degree and then doing a masters on CS (still in planning, maybe 2026). I'm the only guy on the company who uses python and people here thinks I'm a genius because I have automated some boring things from excel.

  • best way to access databases in different projects
  • I have a Datawerehouse some of the dabases I got come from there, but can only be accessed in the virtual machine.

  • best way to access databases in different projects
  • There's some reports that need to be run monthly, they need to be edited each month to add the directories with the new databases and it causes problems, some of them im trying to solve with this. There's also a lot of ad hoc statistics studies I need to do, that use the same bases.

  • best way to access databases in different projects
  • Never heard of that, just saw a video and even if isn't exactly what I need it's looked really cool.

  • best way to access databases in different projects
  • There's some data that comes in CSV, other are database files, in the SQL server, excel or web apis. From some of them I need to combine multiple sources with different formags even.

    I guess I could have a database with everything more tidy, easier to use, secure and with less failure ratio. I'm still going to prepare the databases (I'm thinking on dataframe objects on a pickle, but I want to experiment with parquetd) so they don't have to be processed every time, but I wanted something I could just write the name of the database and get the update version.

  • best way to access databases in different projects
  • Thanks, I could solve it creating a file with a def get_database(name):

    if name == 'database':

    all the process to create the database

    return database

    And then df = get_database('database') execute all the processes and return it.

  • best way to access databases in different projects

    Hi, I want to know what is the best way to keep the databases I use in different projects? I use a lot of CSVs that I need to prepare every time I'm working with them (I just copy paste the code from other projects) but would like to make some module that I can import and it have all the processes of the databases for example for this database I usually do columns = [(configuration of, my columns)], names = [names], dates = [list of columns dates], dtypes ={column: type},

    then database_1 = pd.read_fwf(**kwargs), database_2 = pd.read_fwf(**kwargs), database_3 = pd.read_fwf(**kwargs)...

    Then database = pd.concat([database_1...])

    But I would like to have a module that I could import and have all my databases and configuration of ETL in it so I could just do something like 'database = my_module.dabase' to import the database, without all that process everytime.

    Thanks for any help.

    18
    Why the heck aren't all the "old" series/movies available to buy anywhere?
  • That's why Netflix's Evangelion don't have "fly me to the moon"

  • Calc: How do I use discrete (text) values?
  • Can't test now but ChatGPT said this:

    Creating a drop-down list in LibreOffice Calc involves using the Data Validity feature. Here are the steps to create a drop-down list:

    1. Open LibreOffice Calc: Open your spreadsheet in LibreOffice Calc.

    2. Select the Cells: Click on the cell or select the range of cells where you want the drop-down list to appear.

    3. Open Data Validity: Go to the menu and click on Data > Validity....

    4. Set Criteria: In the Validity dialog box, go to the Criteria tab.

      • From the Allow drop-down menu, select List.
      • In the Entries field, type the values you want to appear in the drop-down list. Separate each value with a comma. For example, type Option 1, Option 2, Option 3.
    5. Optional Settings:

      • Go to the Input Help tab to provide users with instructions or help text when they select the cell.
      • Use the Error Alert tab to define how Calc should behave if an invalid value is entered.
    6. Click OK: Once you've configured the settings, click OK.

    Now, the selected cells will have a drop-down arrow, and users can choose from the list of values you defined.

    If your list of values is long, you might want to reference a range of cells instead of typing each value manually. Here's how:

    1. List Values in a Range: List your values in a separate column or sheet.

    2. Name the Range: Select the range of cells with your values. Go to Sheet > Named Ranges and Expressions > Define. Name your range (e.g., MyRange).

    3. Data Validity: Follow steps 3-4 above, but instead of typing values in the Entries field, type =$MyRange.

    4. Click OK: Once you've configured the settings, click OK.

    This method makes it easier to update your list of values without modifying the Data Validity settings.

  • uwu
  • ỌwỌ

  • House of the Dragon - S02E02 Post-Episode Discussion!
  • I think it also have to do with open keeping face and pretending to not know what's happening.

  • House of the Dragon - S02E02 Post-Episode Discussion!
  • MF Cole complaining about the white cloak when he's the one disrespect it. Also, os easy yo have your cloak clean when you're an useless that dosen't do shit.

  • The heart we can't neglect indeed
  • He kinda control the WHO via donation budgets.

  • Automation
  • Early chess engine that used AI, were trained by games of GMs, and the engine would go out of its way to sacrifice the queen, because when GMs do it, it's comes with a victory.

  • how to send the icecream output to a log file? [solved]

    Hi, I'm currently using this to log my python process

    logging.basicConfig(filename='filename.log', level=logging.DEBUG)

    logger = logging.getLogger()

    sys.stderr.write = logger.error

    sys.stdout.write = logger.info

    And then using print(f'{datetime.now()} log message') where I want to log.

    It's working OK, buy I would like to live it to ic, but can't find any info on how to send the ic output to the logger.

    Thanks for any help.

    7
    alguem mais está com problemas pra postar em outras instâncias?

    Acabei de ver que meus comentários não estão sendo postados em threads que ficam em outros servidores.

    Sou eu só o a gente está com problemas de federação?

    Edit: estive stalkeando outros membros de lemmy.eco.br e nenhum do nossos mensagens está sendo postado nas outras comunidades mas a gente se consegue ver eles.

    6
    how to optimize this kind of process

    Hi, When im working with some big dataframes and I need to create some columns based on functions. So i have some code like this

    Def function(row): function

    And then I run the function on the df as

    df['new column'] = df.apply(function, axis=1)

    But I do this with 10 or more columns/functions at time. I don't think this is efficient because each time a column is created it had to parce the entire data frame. There's a way to create all the columns at the same time while parsing the rows only once?

    Thanks for any help.

    5
    0
    driving_crooner driving_crooner @lemmy.eco.br
    Posts 47
    Comments 1.5K
    Moderates