Python: parse multiple tables into one csv [on hold]












-3














i have a csv file where all tables are underneath each other.
All tables have a MasterId with which I could link them.
Currently I try it with pandas.pivot_table



Here how the csv looks like now



masterId featureName featureValue
1 bar fooo
2 bar x
3 bar y
4 bar z

masterId featureName featureValue
1 zzz m
2 zzz p
3 zzz q
4 zzz r

.
.
.


How i want it to look like



masterId    bar   zzz
1 foo m
2 x p
3 y q
4 z r


Here my code to traspose



transposedTables = pd.pivot_table(
untransposedDataFrame,
index=["masterId"],
columns=["featureName"],
values=["featureValue"],
aggfunc=[np.sum],
dropna=True)

transposedTables.to_csv('./transposed_export_07012019.csv')


But some values remain empty although there is an entry for it



enter image description here



Do you have an idea why the fields are empty?
It has about Tables with each 10k lines and 19mb



i would be happy about hints










share|improve this question







New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
    – Graham
    2 days ago
















-3














i have a csv file where all tables are underneath each other.
All tables have a MasterId with which I could link them.
Currently I try it with pandas.pivot_table



Here how the csv looks like now



masterId featureName featureValue
1 bar fooo
2 bar x
3 bar y
4 bar z

masterId featureName featureValue
1 zzz m
2 zzz p
3 zzz q
4 zzz r

.
.
.


How i want it to look like



masterId    bar   zzz
1 foo m
2 x p
3 y q
4 z r


Here my code to traspose



transposedTables = pd.pivot_table(
untransposedDataFrame,
index=["masterId"],
columns=["featureName"],
values=["featureValue"],
aggfunc=[np.sum],
dropna=True)

transposedTables.to_csv('./transposed_export_07012019.csv')


But some values remain empty although there is an entry for it



enter image description here



Do you have an idea why the fields are empty?
It has about Tables with each 10k lines and 19mb



i would be happy about hints










share|improve this question







New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
    – Graham
    2 days ago














-3












-3








-3







i have a csv file where all tables are underneath each other.
All tables have a MasterId with which I could link them.
Currently I try it with pandas.pivot_table



Here how the csv looks like now



masterId featureName featureValue
1 bar fooo
2 bar x
3 bar y
4 bar z

masterId featureName featureValue
1 zzz m
2 zzz p
3 zzz q
4 zzz r

.
.
.


How i want it to look like



masterId    bar   zzz
1 foo m
2 x p
3 y q
4 z r


Here my code to traspose



transposedTables = pd.pivot_table(
untransposedDataFrame,
index=["masterId"],
columns=["featureName"],
values=["featureValue"],
aggfunc=[np.sum],
dropna=True)

transposedTables.to_csv('./transposed_export_07012019.csv')


But some values remain empty although there is an entry for it



enter image description here



Do you have an idea why the fields are empty?
It has about Tables with each 10k lines and 19mb



i would be happy about hints










share|improve this question







New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











i have a csv file where all tables are underneath each other.
All tables have a MasterId with which I could link them.
Currently I try it with pandas.pivot_table



Here how the csv looks like now



masterId featureName featureValue
1 bar fooo
2 bar x
3 bar y
4 bar z

masterId featureName featureValue
1 zzz m
2 zzz p
3 zzz q
4 zzz r

.
.
.


How i want it to look like



masterId    bar   zzz
1 foo m
2 x p
3 y q
4 z r


Here my code to traspose



transposedTables = pd.pivot_table(
untransposedDataFrame,
index=["masterId"],
columns=["featureName"],
values=["featureValue"],
aggfunc=[np.sum],
dropna=True)

transposedTables.to_csv('./transposed_export_07012019.csv')


But some values remain empty although there is an entry for it



enter image description here



Do you have an idea why the fields are empty?
It has about Tables with each 10k lines and 19mb



i would be happy about hints







python-3.x pandas






share|improve this question







New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









s3niots3niot

1




1




New contributor




s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






s3niot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Graipher, Hosch250, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
    – Graham
    2 days ago














  • 1




    Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
    – Graham
    2 days ago








1




1




Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
– Graham
2 days ago




Welcome to Code Review! I'm afraid your question is not right for our site. We only review working code here. You can see our help center for more details about what is on-topic. You may be able to receive better help on Stack Overflow, but be sure to read their help pages and search around for similar questions before asking.
– Graham
2 days ago










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Сан-Квентин

8-я гвардейская общевойсковая армия

Алькесар