Creating list of series to list of dfs
Project description
#Description: this function: <l_pdseries_2_l_dfs> converts a list of #pandas series to list of pandas data frame. For further easy analysis of #list of dfs. Many times we are faced that we have a list of list of pandas df. # this function helps in such situations
#To use:
import l_pdseries_2_l_dfs as s2df
l_series_2_l_dfs = s2df.l_pdseries_2_l_dfs(l_series, ndfs)
#where l_series is a list of pandas series. It must be of the shape:
>>shape_of_l_series = [inner_element.shape for inner_element in l_series] >>shape_of_l_series
- [(1232,),
(1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1232,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (1110,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (234,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (1930,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,), (841,)]
# so we have a list of series of pandas series with shapes each: [(1232,), (1110,), (234,), (1930,), #(841,)] #So if we want to create a data frame out of these list of series we can use the above module. #Again we have 33 series (columns) of each of the shape, so we want to make a data frame with 33. Also, #we have 5 different series so we want to have 5 dfs. hence, ndfs = 5 in this case. please choose #according to your data the value of ndfs. correct value of ndfs is imporant otherwise it will throw #error. The return value of module is a list of data frames of shape: [(1207, 33), (1086, 33), (234, #33), (1905, 33), (816, 33)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file l_pdseries_2_l_dfs-0.1.tar.gz.
File metadata
- Download URL: l_pdseries_2_l_dfs-0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeaaed4f5f26e7a4f4c0188bb1de83f7ed394e58d0d2bb4b53c8c50eface07f4
|
|
| MD5 |
a6b946008d3c9d2e66983780b3314f0f
|
|
| BLAKE2b-256 |
405c84f89cf556f5f384fde135a00e75980654d9af85711b9e8191fe51e81d17
|