Forum Replies Created

Viewing 1 - 3 of 3 posts
  • yiyiyi

    Member
    October 26, 2020 at 12:08 pm
    Up
    0
    Down

    And then to answer your loop question, if you’d like to read in these df using loops, this is definitely feasible. We could simply do something like this: for i in range(Len(row)): [list of names you defined before] [i] = raw[i]

  • yiyiyi

    Member
    October 26, 2020 at 12:02 pm
    Up
    0
    Down

    Hello, very good question, but in this case, we don’t need to convert these 20 elements into date frames because they are already date frames. You could use isinstance(raw[X], pd.DataFrame) to check and we will see that these are data frames already.

  • yiyiyi

    Member
    October 26, 2020 at 8:01 pm
    Up
    1
    Down

    because when we call every element from the list, the one we are calling is actually the name. So what I refers is:

    we need the name but not overwrite. You could try:

    locals()[“df”+ str(i) ] = raw[i]

    this will create 20 dfs with names df1 … df20 like you did

    • This reply was modified 3 years, 6 months ago by  Justin.
    • This reply was modified 3 years, 6 months ago by  Justin.
Viewing 1 - 3 of 3 posts
error: Content is protected !!