You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Pandas concat function to concatenate DataFrames, any code following the concat call is mistakenly marked as unreachable, even though it should be executed.
import pandas as pd
def concatenate_dfs(dfs):
final_df = pd.concat(dfs, ignore_index=True)
#Following line should be reachable, but it's marked as unreachable
final_df.reset_index(drop=True, inplace=True)
return final_df
When using the Pandas concat function to concatenate DataFrames, any code following the concat call is mistakenly marked as unreachable, even though it should be executed.
import pandas as pd
def concatenate_dfs(dfs):
final_df = pd.concat(dfs, ignore_index=True)
#Following line should be reachable, but it's marked as unreachable
final_df.reset_index(drop=True, inplace=True)
return final_df
Example usage
dfs = [pd.DataFrame({'A': [1, 2, 3]}), pd.DataFrame({'A': [4, 5, 6]})]
result_df = concatenate_dfs(dfs)
print(result_df)
The text was updated successfully, but these errors were encountered: